Skip to content

feat: init project

feat: init project #3

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-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y yq
- 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."