38
38
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39
39
HUSKY : 0
40
40
REF : ${{ github.head_ref || github.ref_name }}
41
+ SHA : ${{ github.event.pull_request.head.sha || github.sha }}
41
42
concurrency :
42
43
group : ${{ github.workflow }}-${{ github.ref }}
43
44
cancel-in-progress : true
82
83
- id : version-typescript
83
84
name : Get TypeScript version
84
85
run : echo "result=$(jq .devDependencies.typescript package.json -r)" >> $GITHUB_OUTPUT
85
- gitguardian :
86
+ commitlint :
86
87
needs : metadata
87
88
runs-on : ubuntu-latest
89
+ steps :
90
+ - id : checkout
91
+ name : Checkout ${{ env.REF }}
92
+ uses : actions/checkout@v3.3.0
93
+ with :
94
+ fetch-depth : 0
95
+ ref : ${{ env.REF }}
96
+ - id : node
97
+ name : Setup Node.js
98
+ uses : actions/setup-node@v3.6.0
99
+ with :
100
+ cache : yarn
101
+ cache-dependency-path : yarn.lock
102
+ node-version-file : .nvmrc
103
+ - id : cache
104
+ name : Restore dependencies cache
105
+ uses : actions/cache@v3.2.6
106
+ with :
107
+ key : ${{ runner.os }}-${{ github.run_id }}
108
+ path : ${{ env.CACHE_PATH }}
109
+ - id : build
110
+ name : Build project
111
+ run : yarn build
112
+ - id : lint
113
+ name : Check commitlint status
114
+ run : yarn commitlint --from $SHA~${{ github.event.pull_request.commits || 1 }} --to $SHA
115
+ gitguardian :
116
+ needs : commitlint
117
+ runs-on : ubuntu-latest
88
118
steps :
89
119
- id : checkout
90
120
name : Checkout ${{ env.REF }}
@@ -104,7 +134,7 @@ jobs:
104
134
GITHUB_PUSH_BASE_SHA : ${{ github.event.base }}
105
135
GITHUB_PUSH_BEFORE_SHA : ${{ github.event.before }}
106
136
format :
107
- needs : metadata
137
+ needs : commitlint
108
138
runs-on : ubuntu-latest
109
139
steps :
110
140
- id : checkout
@@ -129,7 +159,7 @@ jobs:
129
159
name : Check code formatting
130
160
run : yarn check:format
131
161
lint :
132
- needs : metadata
162
+ needs : commitlint
133
163
runs-on : ubuntu-latest
134
164
steps :
135
165
- id : checkout
@@ -157,7 +187,7 @@ jobs:
157
187
name : Check lint status
158
188
run : yarn check:lint
159
189
spelling :
160
- needs : metadata
190
+ needs : commitlint
161
191
runs-on : ubuntu-latest
162
192
steps :
163
193
- id : checkout
@@ -182,7 +212,9 @@ jobs:
182
212
name : Check spelling
183
213
run : yarn check:spelling
184
214
typescript :
185
- needs : metadata
215
+ needs :
216
+ - commitlint
217
+ - metadata
186
218
runs-on : ubuntu-latest
187
219
strategy :
188
220
fail-fast : false
@@ -229,7 +261,7 @@ jobs:
229
261
name : Run typecheck
230
262
run : yarn typecheck
231
263
test :
232
- needs : metadata
264
+ needs : commitlint
233
265
runs-on : ubuntu-latest
234
266
strategy :
235
267
fail-fast : false
@@ -271,18 +303,20 @@ jobs:
271
303
flags : ${{ format('node{0}', matrix.node-version) }}
272
304
override_branch : ${{ env.REF }}
273
305
override_build : ${{ github.run_id }}
274
- override_commit : ${{ env.GITHUB_SHA }}
306
+ override_commit : ${{ env.SHA }}
275
307
token : ${{ secrets.CODECOV_TOKEN }}
276
308
verbose : true
277
309
env :
278
310
GITHUB_JOB : ${{ github.job }}
279
311
GITHUB_REF : ${{ github.ref }}
280
312
GITHUB_REF_TYPE : ${{ github.ref_type }}
281
313
GITHUB_RUN_ID : ${{ github.run_id }}
282
- GITHUB_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
314
+ GITHUB_SHA : ${{ env.SHA }}
283
315
GITHUB_WORKSPACE : ${{ github.workspace }}
284
316
build :
285
- needs : metadata
317
+ needs :
318
+ - commitlint
319
+ - metadata
286
320
runs-on : ubuntu-latest
287
321
steps :
288
322
- id : checkout
0 commit comments