File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Lint JSON
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - main
8+ pull_request :
9+ branches-ignore :
10+ - translations
11+
12+ jobs :
13+ see_if_should_skip :
14+ runs-on : ubuntu-latest
15+
16+ outputs :
17+ should_skip : ${{ steps.skip_check.outputs.should_skip }}
18+ steps :
19+ - id : skip_check
20+ uses : fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289
21+ with :
22+ cancel_others : ' false'
23+ github_token : ${{ github.token }}
24+ paths : ' ["**/*.json", ".github/workflows/json-lint.yml"]'
25+
26+ lint :
27+ runs-on : ubuntu-latest
28+ needs : see_if_should_skip
29+ if : ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
30+ steps :
31+ - name : Check out repo
32+ uses : actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
33+
34+ - name : Setup node
35+ uses : actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
36+ with :
37+ node-version : 14.x
38+
39+ - name : Get npm cache directory
40+ id : npm-cache
41+ run : |
42+ echo "::set-output name=dir::$(npm config get cache)"
43+
44+ - name : Cache node modules
45+ uses : actions/cache@0781355a23dac32fd3bac414512f4b903437991a
46+ with :
47+ path : ${{ steps.npm-cache.outputs.dir }}
48+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
49+ restore-keys : |
50+ ${{ runner.os }}-node-
51+
52+ - name : Install dependencies
53+ run : npm ci
54+
55+ - name : Run linter
56+ run : npx prettier -c "**/*.json"
You can’t perform that action at this time.
0 commit comments