Skip to content

Commit 9587b67

Browse files
committed
fix(ci): skip cache restore when force rebuild is requested
Add 'if: inputs.force != true' condition to cache restore steps to ensure --force flag actually rebuilds from scratch instead of using cached artifacts. Current behavior (broken): - Cache restore steps always run - Cache hits prevent rebuilds - Force flag only affects build conditions (too late) Fixed behavior: - Cache restore skipped when inputs.force = true - Builds run from scratch - No cache hits to prevent rebuild Changes: - build-sea.yml: Skip SEA binary cache restore on force - build-smol.yml: Skip build/stripped/binary cache restores on force Note: ccache and WASM caches still restore (desired for speed).
1 parent 1877bb1 commit 9587b67

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.github/workflows/build-sea.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ jobs:
257257
echo "hash=$HASH" >> $GITHUB_OUTPUT
258258
259259
- name: Restore SEA binary cache
260+
if: inputs.force != true
260261
id: sea-cache
261262
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
262263
with:

.github/workflows/build-smol.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
max-size: 2G
100100

101101
- name: Restore smol build cache
102+
if: inputs.force != true
102103
id: smol-build-cache
103104
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
104105
with:
@@ -108,6 +109,7 @@ jobs:
108109
node-smol-build-${{ matrix.platform }}-${{ matrix.arch }}-
109110
110111
- name: Restore smol stripped binary cache
112+
if: inputs.force != true
111113
id: smol-stripped-cache
112114
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
113115
with:
@@ -116,6 +118,7 @@ jobs:
116118
restore-keys: node-smol-stripped-${{ matrix.platform }}-${{ matrix.arch }}-
117119

118120
- name: Restore smol binary cache
121+
if: inputs.force != true
119122
id: smol-cache
120123
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
121124
with:

0 commit comments

Comments
 (0)