Skip to content

Commit 291a9f2

Browse files
do not cache in build workflow when running on release (#311)
1 parent 18e3844 commit 291a9f2

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
echo "ARCH=${arch:-'unknown'}" >> $GITHUB_ENV
9393
9494
- name: Cache rustup toolchain
95+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
9596
uses: actions/cache@v4
9697
with:
9798
path: |
@@ -101,7 +102,7 @@ jobs:
101102
${{ runner.os }}-${{ runner.arch }}-rustup-
102103
103104
- name: Cache Homebrew packages (macOS)
104-
if: ${{ runner.os == 'macOS' }}
105+
if: ${{ !startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS' }}
105106
uses: actions/cache@v4
106107
with:
107108
path: |
@@ -116,7 +117,7 @@ jobs:
116117
target: ${{ env.TARGET }}
117118

118119
- name: Cache Zig toolchain
119-
if: ${{ runner.os == 'Linux' && matrix.platform.target == 'aarch64' }}
120+
if: ${{ !startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux' && matrix.platform.target == 'aarch64' }}
120121
id: cache-zig
121122
uses: actions/cache@v4
122123
with:
@@ -294,6 +295,7 @@ jobs:
294295
python-version: 3.x
295296

296297
- name: Cache rustup toolchain
298+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
297299
uses: actions/cache@v4
298300
with:
299301
path: |
@@ -303,6 +305,7 @@ jobs:
303305
${{ runner.os }}-${{ runner.arch }}-rustup-
304306
305307
- name: Cache Cargo registry
308+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
306309
uses: actions/cache@v4
307310
with:
308311
path: |
@@ -345,6 +348,7 @@ jobs:
345348
python-version: 3.x
346349

347350
- name: Cache rustup toolchain
351+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
348352
uses: actions/cache@v4
349353
with:
350354
path: |
@@ -354,6 +358,7 @@ jobs:
354358
${{ runner.os }}-${{ runner.arch }}-rustup-
355359
356360
- name: Cache Cargo registry
361+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
357362
uses: actions/cache@v4
358363
with:
359364
path: |

.github/zizmor.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
rules:
2+
cache-poisoning:
3+
ignore:
4+
# test workflow does not produce artifacts to poison
5+
- test.yml
6+
# all caching is disabled when a tag is pushed
7+
- build.yml:96:9
8+
- build.yml:106:9
9+
- build.yml:115:9
10+
- build.yml:122:9
11+
- build.yml:236:9
12+
- build.yml:268:9
13+
- build.yml:299:9
14+
- build.yml:309:9
15+
- build.yml:321:9
16+
- build.yml:352:9
17+
- build.yml:362:9
18+
- build.yml:374:9

0 commit comments

Comments
 (0)