File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Validate action.yml
2
+
3
+ on :
4
+ pull_request :
5
+ paths :
6
+ - " .github/workflows/validate-action_yml.yml"
7
+ - " action.yml"
8
+ push :
9
+ paths :
10
+ - " .github/workflows/validate-action_yml.yml"
11
+ - " action.yml"
12
+ # Scheduled trigger to catch workflow failure resulting from changes to the JSON schema
13
+ schedule :
14
+ # run every Tuesday at 3 AM UTC
15
+ - cron : " 0 3 * * 2"
16
+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
17
+ workflow_dispatch :
18
+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
19
+ repository_dispatch :
20
+
21
+ jobs :
22
+ validate :
23
+ runs-on : ubuntu-latest
24
+
25
+ env :
26
+ JSON_SCHEMA_FOLDER : etc/github-action-json-schema
27
+ JSON_SCHEMA_FILENAME : github-action.json
28
+
29
+ steps :
30
+ - name : Checkout local repository
31
+ uses : actions/checkout@v2
32
+
33
+ # See: https://github.com/carlosperate/download-file-action/blob/master/README.md
34
+ - name : Download JSON schema for action.yml
35
+ uses :
carlosperate/[email protected]
36
+ with :
37
+ # See: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-action.json
38
+ file-url : https://json.schemastore.org/github-action
39
+ location : ${{ env.JSON_SCHEMA_FOLDER }}
40
+ file-name : ${{ env.JSON_SCHEMA_FILENAME }}
41
+
42
+ - name : Install JSON schema validator
43
+ run : sudo npm install --global ajv-cli
44
+
45
+ # See: https://github.com/ajv-validator/ajv-cli/blob/master/README.md
46
+ - name : Validate action.yml
47
+ run : ajv -s "${{ env.JSON_SCHEMA_FOLDER }}/${{ env.JSON_SCHEMA_FILENAME }}" -d action.yml
You can’t perform that action at this time.
0 commit comments