ci: POSIX-safe example-validation loop (trixie-slim sh is dash, no shopt)
All checks were successful
validate / Rego (opa fmt + opa test) (push) Successful in 13s
validate / JSON Schema (ajv) (push) Successful in 17s

This commit is contained in:
CTO Agent 2026-10-25 15:41:18 +00:00
parent 23594e1f9b
commit 36aa391e59

View file

@ -60,13 +60,12 @@ jobs:
- name: Validate example payloads against their schemas (if any)
working-directory: ${{ github.workspace }}
run: |
set -euo pipefail
set -eu
export NODE_PATH=/tmp/ajv/node_modules
shopt -s nullglob
for schema in $(find schemas -type f -name '*.json'); do
find schemas -type f -name 'v*.json' -print | while IFS= read -r schema; do
dir="$(dirname "$schema")/examples"
[ -d "$dir" ] || continue
for example in "$dir"/*.json; do
find "$dir" -type f -name '*.json' -print | while IFS= read -r example; do
echo "--- validate example $example against $schema"
node /tmp/ajv/node_modules/.bin/ajv validate --spec=draft2020 -c=ajv-formats -s "$schema" -d "$example"
done