Skip to content

Commit

Permalink
workflows:check-json - add checks for actions schema
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Nov 1, 2023
1 parent c861ba3 commit 758742c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/check-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ on:
push:
paths:
- '**.json'
- '**.yml'
- '**.yaml'

env:
PYTHON_VERSION: 3.10

jobs:
json-check:
check-schemata:
name: Check Schemata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: json-syntax-check
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: python -m pip install jsonschema pyyaml
- name: Check JSON Syntax
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"
- name: Check Actions Schema
run: python -c 'import yaml,json,jsonschema,sys;jsonschema.validate(yaml.load(open(sys.argv[1]), yaml.Loader), json.load(open(sys.argv[2])))' actions.yml actions.schema.json

0 comments on commit 758742c

Please sign in to comment.