File tree 1 file changed +60
-0
lines changed
1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Check npm
2
+
3
+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
4
+ on :
5
+ push :
6
+ paths :
7
+ - " .github/workflows/check-npm.yml"
8
+ - " **/package.json"
9
+ - " **/package-lock.json"
10
+ pull_request :
11
+ paths :
12
+ - " .github/workflows/check-npm.yml"
13
+ - " **/package.json"
14
+ - " **/package-lock.json"
15
+ schedule :
16
+ # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema.
17
+ - cron : " 0 8 * * TUE"
18
+ workflow_dispatch :
19
+ repository_dispatch :
20
+
21
+ jobs :
22
+ validate :
23
+ runs-on : ubuntu-latest
24
+
25
+ steps :
26
+ - name : Checkout repository
27
+ uses : actions/checkout@v2
28
+
29
+ - name : Download JSON schema for package.json
30
+ id : download-schema
31
+ uses :
carlosperate/[email protected]
32
+ with :
33
+ # See: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
34
+ file-url : https://json.schemastore.org/package.json
35
+ location : ${{ runner.temp }}/package-json-schema
36
+ file-name : package-json-schema.json
37
+
38
+ - name : Install JSON schema validator
39
+ # package.json schema is draft-04, which is not supported by ajv-cli >=4.
40
+ run :
sudo npm install --global [email protected]
41
+
42
+ - name : Validate GitHub Actions workflows
43
+ run : |
44
+ # See: https://github.com/ajv-validator/ajv-cli#readme
45
+ ajv validate \
46
+ -s "${{ steps.download-schema.outputs.file-path }}" \
47
+ -d "./**/package.json"
48
+
49
+ check-manifest :
50
+ runs-on : ubuntu-latest
51
+
52
+ steps :
53
+ - name : Checkout repository
54
+ uses : actions/checkout@v2
55
+
56
+ - name : Install dependencies
57
+ run : npm install
58
+
59
+ - name : Check manifest
60
+ run : git diff --color --exit-code package-lock.json
You can’t perform that action at this time.
0 commit comments