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+ 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
88118 steps :
89119 - id : checkout
90120 name : Checkout ${{ env.REF }}
@@ -104,7 +134,7 @@ jobs:
104134 GITHUB_PUSH_BASE_SHA : ${{ github.event.base }}
105135 GITHUB_PUSH_BEFORE_SHA : ${{ github.event.before }}
106136 format :
107- needs : metadata
137+ needs : commitlint
108138 runs-on : ubuntu-latest
109139 steps :
110140 - id : checkout
@@ -129,7 +159,7 @@ jobs:
129159 name : Check code formatting
130160 run : yarn check:format
131161 lint :
132- needs : metadata
162+ needs : commitlint
133163 runs-on : ubuntu-latest
134164 steps :
135165 - id : checkout
@@ -157,7 +187,7 @@ jobs:
157187 name : Check lint status
158188 run : yarn check:lint
159189 spelling :
160- needs : metadata
190+ needs : commitlint
161191 runs-on : ubuntu-latest
162192 steps :
163193 - id : checkout
@@ -182,7 +212,9 @@ jobs:
182212 name : Check spelling
183213 run : yarn check:spelling
184214 typescript :
185- needs : metadata
215+ needs :
216+ - commitlint
217+ - metadata
186218 runs-on : ubuntu-latest
187219 strategy :
188220 fail-fast : false
@@ -229,7 +261,7 @@ jobs:
229261 name : Run typecheck
230262 run : yarn typecheck
231263 test :
232- needs : metadata
264+ needs : commitlint
233265 runs-on : ubuntu-latest
234266 strategy :
235267 fail-fast : false
@@ -271,18 +303,20 @@ jobs:
271303 flags : ${{ format('node{0}', matrix.node-version) }}
272304 override_branch : ${{ env.REF }}
273305 override_build : ${{ github.run_id }}
274- override_commit : ${{ env.GITHUB_SHA }}
306+ override_commit : ${{ env.SHA }}
275307 token : ${{ secrets.CODECOV_TOKEN }}
276308 verbose : true
277309 env :
278310 GITHUB_JOB : ${{ github.job }}
279311 GITHUB_REF : ${{ github.ref }}
280312 GITHUB_REF_TYPE : ${{ github.ref_type }}
281313 GITHUB_RUN_ID : ${{ github.run_id }}
282- GITHUB_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
314+ GITHUB_SHA : ${{ env.SHA }}
283315 GITHUB_WORKSPACE : ${{ github.workspace }}
284316 build :
285- needs : metadata
317+ needs :
318+ - commitlint
319+ - metadata
286320 runs-on : ubuntu-latest
287321 steps :
288322 - id : checkout
0 commit comments