Skip to content

Commit

Permalink
Merge pull request #5532 from nextcloud/ci/json-validator/use-venv
Browse files Browse the repository at this point in the history
ci(json-validator): use venv
  • Loading branch information
szaimen authored Nov 6, 2024
2 parents 72d1c2c + 4f808d2 commit 45a0350
Showing 1 changed file with 37 additions and 36 deletions.
73 changes: 37 additions & 36 deletions .github/workflows/json-validator.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
name: Json Validator

on:
pull_request:
paths:
- '**.json'
push:
branches:
- main
paths:
- '**.json'

jobs:
json-validator:
name: Json Validator
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate Json
run: |
sudo apt-get update
sudo apt-get install python3-pip -y --no-install-recommends
pip3 install json-spec
export PATH="$PATH:/home/runner/.local/bin"
if ! json validate --schema-file=php/containers-schema.json --document-file=php/containers.json; then
exit 1
fi
JSON_FILES="$(find ./community-containers -name '*.json')"
mapfile -t JSON_FILES <<< "$JSON_FILES"
for file in "${JSON_FILES[@]}"; do
json validate --schema-file=php/containers-schema.json --document-file="$file" 2>&1 | tee -a ./json-validator.log
done
if grep -q "document does not validate with schema.\|invalid JSONFile" ./json-validator.log; then
exit 1
fi
name: Json Validator

on:
pull_request:
paths:
- '**.json'
push:
branches:
- main
paths:
- '**.json'

jobs:
json-validator:
name: Json Validator
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate Json
run: |
sudo apt-get update
sudo apt-get install python3-venv -y --no-install-recommends
python3 -m venv venv
. venv/bin/activate
pip3 install json-spec
if ! json validate --schema-file=php/containers-schema.json --document-file=php/containers.json; then
exit 1
fi
JSON_FILES="$(find ./community-containers -name '*.json')"
mapfile -t JSON_FILES <<< "$JSON_FILES"
for file in "${JSON_FILES[@]}"; do
json validate --schema-file=php/containers-schema.json --document-file="$file" 2>&1 | tee -a ./json-validator.log
done
if grep -q "document does not validate with schema.\|invalid JSONFile" ./json-validator.log; then
exit 1
fi

0 comments on commit 45a0350

Please sign in to comment.