ci: POSIX-safe example-validation loop (trixie-slim sh is dash, no shopt)
This commit is contained in:
parent
23594e1f9b
commit
36aa391e59
1 changed files with 3 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue