Files
validate-json-by-json-schem…/action.yml
Renovate Bot 296da3a42a
All checks were successful
CD / Release (push) Successful in 12s
chore(deps): update actions/setup-node action to v6 (#6)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/setup-node](https://github.com/actions/setup-node) | action | major | `v5` → `v6` |

---

### Release Notes

<details>
<summary>actions/setup-node (actions/setup-node)</summary>

### [`v6`](https://github.com/actions/setup-node/compare/v5...v6)

[Compare Source](https://github.com/actions/setup-node/compare/v5...v6)

</details>

---

### 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.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDYuOCIsInVwZGF0ZWRJblZlciI6IjQyLjkyLjE0IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhY3Rpb24iLCJkZXBzIl19-->

Co-authored-by: t.behrendt <t.behrendt@t00n.de>
Reviewed-on: #6
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-02-06 08:14:50 +01:00

34 lines
950 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@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
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