feat: init project #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate updates | |
on: | |
push: | |
paths: | |
- 'updates.yaml' | |
- 'updates.schema.json' | |
pull_request: | |
paths: | |
- 'updates.yaml' | |
- 'updates.schema.json' | |
jobs: | |
validate-yaml: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install Ajv CLI and js-yaml | |
run: | | |
npm install -g ajv-cli | |
npm install -g js-yaml | |
- name: Validate updates.yaml | |
id: validate-updates | |
run: | | |
js-yaml updates.yaml > converted-file.json | |
ajv validate -s updates.schema.json -d converted-file.json | |
- name: Print success message | |
if: success() | |
run: echo "YAML file validated successfully against the schema." | |
- name: Print failure message | |
if: failure() | |
run: echo "YAML validation failed. Check the schema and the YAML file." |