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 : 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
@@ -224,7 +258,9 @@ jobs:
224
258
name : Run typecheck
225
259
run : yarn typecheck
226
260
test :
227
- needs : gitguardian
261
+ needs :
262
+ - commitlint
263
+ - gitguardian
228
264
runs-on : ubuntu-latest
229
265
strategy :
230
266
fail-fast : false
@@ -266,18 +302,19 @@ jobs:
266
302
flags : ${{ format('node{0}', matrix.node-version) }}
267
303
override_branch : ${{ env.REF }}
268
304
override_build : ${{ github.run_id }}
269
- override_commit : ${{ env.GITHUB_SHA }}
305
+ override_commit : ${{ env.SHA }}
270
306
token : ${{ secrets.CODECOV_TOKEN }}
271
307
verbose : true
272
308
env :
273
309
GITHUB_JOB : ${{ github.job }}
274
310
GITHUB_REF : ${{ github.ref }}
275
311
GITHUB_REF_TYPE : ${{ github.ref_type }}
276
312
GITHUB_RUN_ID : ${{ github.run_id }}
277
- GITHUB_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
313
+ GITHUB_SHA : ${{ env.SHA }}
278
314
GITHUB_WORKSPACE : ${{ github.workspace }}
279
315
build :
280
316
needs :
317
+ - commitlint
281
318
- gitguardian
282
319
- metadata
283
320
runs-on : ubuntu-latest
0 commit comments