-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (30 loc) · 1.11 KB
/
ci_schema.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: CI action schema
on:
push: {}
pull_request:
branches: [main]
defaults:
run:
shell: bash
jobs:
validate-schema:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pkg
run: pip install check-jsonschema
- name: Scan repo
id: folders
run: python -c "import os; print('gh_actions=' + str(int(os.path.isdir('.github/actions'))))" >> $GITHUB_OUTPUT
# https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
- name: GitHub Actions - workflow
run: |
files=$(find .github/workflows -name '*.yml' -or -name '*.yaml' -not -name '__*')
check-jsonschema -v $files --builtin-schema "github-workflows"
# https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-action.json
- name: GitHub Actions - action
if: steps.folders.outputs.gh_actions == '1'
run: |
files=$(find .github/actions -name '*.yml' -or -name '*.yaml')
heck-jsonschema -v $files --builtin-schema "github-actions"