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
+
93
+ with :
94
+ fetch-depth : 0
95
+ ref : ${{ env.REF }}
96
+ - id : node
97
+ name : Setup Node.js
98
+
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
+
106
+ with :
107
+ key : ${{ runner.os }}-${{ github.run_id }}
108
+ path : ${{ env.CACHE_PATH }}
109
+ - id : lint
110
+ name : Check commitlint status
111
+ run : yarn commitlint --from $SHA~${{ github.event.pull_request.commits || 1 }} --to $SHA
112
+ gitguardian :
113
+ needs : commitlint
114
+ runs-on : ubuntu-latest
88
115
steps :
89
116
- id : checkout
90
117
name : Checkout ${{ env.REF }}
@@ -104,7 +131,9 @@ jobs:
104
131
GITHUB_PUSH_BASE_SHA : ${{ github.event.base }}
105
132
GITHUB_PUSH_BEFORE_SHA : ${{ github.event.before }}
106
133
format :
107
- needs : gitguardian
134
+ needs :
135
+ - commitlint
136
+ - gitguardian
108
137
runs-on : ubuntu-latest
109
138
steps :
110
139
- id : checkout
@@ -129,7 +158,9 @@ jobs:
129
158
name : Check code formatting
130
159
run : yarn check:format
131
160
lint :
132
- needs : gitguardian
161
+ needs :
162
+ - commitlint
163
+ - gitguardian
133
164
runs-on : ubuntu-latest
134
165
steps :
135
166
- id : checkout
@@ -154,7 +185,9 @@ jobs:
154
185
name : Check lint status
155
186
run : yarn check:lint
156
187
spelling :
157
- needs : gitguardian
188
+ needs :
189
+ - commitlint
190
+ - gitguardian
158
191
runs-on : ubuntu-latest
159
192
steps :
160
193
- id : checkout
@@ -180,6 +213,7 @@ jobs:
180
213
run : yarn check:spelling
181
214
typescript :
182
215
needs :
216
+ - commitlint
183
217
- gitguardian
184
218
- metadata
185
219
runs-on : ubuntu-latest
@@ -225,7 +259,9 @@ jobs:
225
259
name : Run typecheck
226
260
run : yarn typecheck
227
261
test :
228
- needs : gitguardian
262
+ needs :
263
+ - commitlint
264
+ - gitguardian
229
265
runs-on : ubuntu-latest
230
266
strategy :
231
267
fail-fast : false
@@ -267,18 +303,19 @@ jobs:
267
303
flags : ${{ format('node{0}', matrix.node-version) }}
268
304
override_branch : ${{ env.REF }}
269
305
override_build : ${{ github.run_id }}
270
- override_commit : ${{ env.GITHUB_SHA }}
306
+ override_commit : ${{ env.SHA }}
271
307
token : ${{ secrets.CODECOV_TOKEN }}
272
308
verbose : true
273
309
env :
274
310
GITHUB_JOB : ${{ github.job }}
275
311
GITHUB_REF : ${{ github.ref }}
276
312
GITHUB_REF_TYPE : ${{ github.ref_type }}
277
313
GITHUB_RUN_ID : ${{ github.run_id }}
278
- GITHUB_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
314
+ GITHUB_SHA : ${{ env.SHA }}
279
315
GITHUB_WORKSPACE : ${{ github.workspace }}
280
316
build :
281
317
needs :
318
+ - commitlint
282
319
- gitguardian
283
320
- metadata
284
321
runs-on : ubuntu-latest
0 commit comments