@@ -143,14 +143,18 @@ jobs:
143
143
- name : Compute dependency cache key
144
144
id : compute_lockfile_hash
145
145
run : echo "hash=${{ hashFiles('yarn.lock') }}" >> "$GITHUB_OUTPUT"
146
+
147
+ # When the `ci-skip-cache` label is added to a PR, we always want to skip dependency cache
146
148
- name : Check dependency cache
147
149
uses : actions/cache@v3
148
150
id : cache_dependencies
151
+ if : needs.job_get_metadata.outputs.force_skip_cache == false
149
152
with :
150
153
path : ${{ env.CACHED_DEPENDENCY_PATHS }}
151
154
key : ${{ steps.compute_lockfile_hash.outputs.hash }}
155
+
152
156
- name : Install dependencies
153
- if : steps.cache_dependencies.outputs.cache-hit == ''
157
+ if : steps.cache_dependencies.outputs.cache-hit == '' || needs.job_get_metadata.outputs.force_skip_cache
154
158
run : yarn install --ignore-engines --frozen-lockfile
155
159
outputs :
156
160
dependency_cache_key : ${{ steps.compute_lockfile_hash.outputs.hash }}
@@ -185,7 +189,10 @@ jobs:
185
189
# - on master
186
190
# - on release branches
187
191
# - when PR has `ci-skip-cache` label
188
- if : github.ref != 'refs/heads/master' && startsWith(github.ref, 'refs/heads/release/') == false
192
+ if : |
193
+ needs.job_get_metadata.outputs.is_master == false &&
194
+ needs.job_get_metadata.outputs.is_release == false &&
195
+ needs.job_get_metadata.outputs.force_skip_cache == false
189
196
with :
190
197
path : node_modules/.cache/nx
191
198
key : nx-${{ runner.os }}-${{ github.ref }}-${{ env.HEAD_COMMIT }}
@@ -254,7 +261,7 @@ jobs:
254
261
timeout-minutes : 15
255
262
runs-on : ubuntu-20.04
256
263
# Size Check will error out outside of the context of a PR
257
- if : github.event_name == 'pull_request' || github.ref == 'refs/heads/master'
264
+ if : github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_master
258
265
steps :
259
266
- name : Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
260
267
uses : actions/checkout@v3
@@ -280,7 +287,7 @@ jobs:
280
287
- name : Check bundle sizes
281
288
uses : getsentry/size-limit-action@v5
282
289
# Don't run size check on release branches - at that point, we're already committed
283
- if : ${{ !startsWith(github.ref, 'refs/heads/release/') }}
290
+ if : needs.job_get_metadata.outputs.is_release == false
284
291
with :
285
292
github_token : ${{ secrets.GITHUB_TOKEN }}
286
293
skip_step : build
@@ -342,7 +349,7 @@ jobs:
342
349
needs : [job_get_metadata, job_build]
343
350
runs-on : ubuntu-20.04
344
351
# Build artifacts are only needed for releasing workflow.
345
- if : startsWith(github.ref, 'refs/heads/release/')
352
+ if : needs.job_get_metadata.outputs.is_release
346
353
steps :
347
354
- name : Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
348
355
uses : actions/checkout@v3
0 commit comments