@@ -238,7 +238,7 @@ jobs:
238
238
- name : " Delete previous compiler cache"
239
239
# Updating th cache doesn't work from forks
240
240
# So update it once it's merged into the repo
241
- if : ${{ steps.compiler-cache-restore.outputs.cache-hit && github.event_name == 'push' }}
241
+ if : ${{ steps.compiler-cache-restore.outputs.cache-hit && github.event_name == 'push' && github.ref_name == 'main' }}
242
242
continue-on-error : true
243
243
run : |
244
244
gh extension install actions/gh-actions-cache
@@ -248,7 +248,7 @@ jobs:
248
248
- name : " Save Compiler Cache"
249
249
# Updating th cache doesn't work from forks
250
250
# So update it once it's merged into the repo
251
- if : ${{ github.event_name == 'push' }}
251
+ if : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
252
252
uses : actions/cache/save@v4
253
253
with :
254
254
path : /home/runner/.cache/sccache
@@ -546,7 +546,7 @@ jobs:
546
546
- name : " Delete previous compiler cache"
547
547
# Updating th cache doesn't work from forks
548
548
# So update it once it's merged into the repo
549
- if : ${{ steps.compiler-cache-restore.outputs.cache-hit && github.event_name == 'push' }}
549
+ if : ${{ steps.compiler-cache-restore.outputs.cache-hit && github.event_name == 'push' && github.ref_name == 'main' }}
550
550
continue-on-error : true
551
551
run : |
552
552
gh extension install actions/gh-actions-cache
@@ -556,7 +556,7 @@ jobs:
556
556
- name : " Save Compiler Cache"
557
557
# Updating th cache doesn't work from forks
558
558
# So update it once it's merged into the repo
559
- if : ${{ github.event_name == 'push' }}
559
+ if : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
560
560
uses : actions/cache/save@v4
561
561
with :
562
562
path : ${{ matrix.compiler_cache_path }}
0 commit comments