3838 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3939 HUSKY : 0
4040 REF : ${{ github.head_ref || github.ref_name }}
41+ SHA : ${{ github.event.pull_request.head.sha || github.sha }}
4142concurrency :
4243 group : ${{ github.workflow }}-${{ github.ref }}
4344 cancel-in-progress : true
8283 - id : version-typescript
8384 name : Get TypeScript version
8485 run : echo "result=$(jq .devDependencies.typescript package.json -r)" >> $GITHUB_OUTPUT
85- gitguardian :
86+ commitlint :
8687 needs : metadata
8788 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
88115 steps :
89116 - id : checkout
90117 name : Checkout ${{ env.REF }}
@@ -104,7 +131,9 @@ jobs:
104131 GITHUB_PUSH_BASE_SHA : ${{ github.event.base }}
105132 GITHUB_PUSH_BEFORE_SHA : ${{ github.event.before }}
106133 format :
107- needs : gitguardian
134+ needs :
135+ - commitlint
136+ - gitguardian
108137 runs-on : ubuntu-latest
109138 steps :
110139 - id : checkout
@@ -129,7 +158,9 @@ jobs:
129158 name : Check code formatting
130159 run : yarn check:format
131160 lint :
132- needs : gitguardian
161+ needs :
162+ - commitlint
163+ - gitguardian
133164 runs-on : ubuntu-latest
134165 steps :
135166 - id : checkout
@@ -154,7 +185,9 @@ jobs:
154185 name : Check lint status
155186 run : yarn check:lint
156187 spelling :
157- needs : gitguardian
188+ needs :
189+ - commitlint
190+ - gitguardian
158191 runs-on : ubuntu-latest
159192 steps :
160193 - id : checkout
@@ -180,6 +213,7 @@ jobs:
180213 run : yarn check:spelling
181214 typescript :
182215 needs :
216+ - commitlint
183217 - gitguardian
184218 - metadata
185219 runs-on : ubuntu-latest
@@ -225,7 +259,9 @@ jobs:
225259 name : Run typecheck
226260 run : yarn typecheck
227261 test :
228- needs : gitguardian
262+ needs :
263+ - commitlint
264+ - gitguardian
229265 runs-on : ubuntu-latest
230266 strategy :
231267 fail-fast : false
@@ -267,18 +303,19 @@ jobs:
267303 flags : ${{ format('node{0}', matrix.node-version) }}
268304 override_branch : ${{ env.REF }}
269305 override_build : ${{ github.run_id }}
270- override_commit : ${{ env.GITHUB_SHA }}
306+ override_commit : ${{ env.SHA }}
271307 token : ${{ secrets.CODECOV_TOKEN }}
272308 verbose : true
273309 env :
274310 GITHUB_JOB : ${{ github.job }}
275311 GITHUB_REF : ${{ github.ref }}
276312 GITHUB_REF_TYPE : ${{ github.ref_type }}
277313 GITHUB_RUN_ID : ${{ github.run_id }}
278- GITHUB_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
314+ GITHUB_SHA : ${{ env.SHA }}
279315 GITHUB_WORKSPACE : ${{ github.workspace }}
280316 build :
281317 needs :
318+ - commitlint
282319 - gitguardian
283320 - metadata
284321 runs-on : ubuntu-latest
0 commit comments