All checks were successful
CD / Release (push) Successful in 6s
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | pinDigest | → `93cb6ef` | | [actions/setup-node](https://github.com/actions/setup-node) | action | pinDigest | → `a0853c2` | | [https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment](https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment) | action | pinDigest | → `e2d3fdb` | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Mi4xNCIsInVwZGF0ZWRJblZlciI6IjQyLjkyLjE0IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhY3Rpb24iLCJkZXBzIl19--> Reviewed-on: #11 Reviewed-by: t.behrendt <t.behrendt@noreply.localhost> Co-authored-by: Renovate Bot <renovate@t00n.de> Co-committed-by: Renovate Bot <renovate@t00n.de>
34 lines
946 B
YAML
34 lines
946 B
YAML
name: "Validate JSON by JSON Schema"
|
|
description: "Validates JSON files using their $schema reference"
|
|
author: "Timo Behrendt <t.behrendt@t00n.de>"
|
|
|
|
inputs:
|
|
json-file:
|
|
description: "The JSON file to validate"
|
|
required: true
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
|
|
with:
|
|
node-version: "latest"
|
|
- name: Extract schema
|
|
shell: bash
|
|
run: |
|
|
schema=$(jq -r '.["$schema"]' < ${{ inputs.json-file }})
|
|
if [ -n "$schema" ]; then
|
|
curl -s $schema > schema.json
|
|
else
|
|
echo "No schema found"
|
|
exit 0
|
|
fi
|
|
- name: Update the schema to the latest version
|
|
shell: bash
|
|
run: |
|
|
npx ajv-cli migrate -s schema.json -o schema.json
|
|
- name: Validate JSON
|
|
shell: bash
|
|
run: |
|
|
npx ajv-cli validate -s schema.json -d ${{ inputs.json-file }} --strict=false
|