Skip to content

Commit

Permalink
ci: Only update caches from main repository
Browse files Browse the repository at this point in the history
Forks are not allowed to update the cache
  • Loading branch information
LeonMatthesKDAB committed Jun 10, 2024
1 parent 44d9be0 commit 146227a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/knut-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
- name: "Delete previous compiler cache"
# Updating th cache doesn't work from forks
# So update it once it's merged into the repo
if: ${{ steps.compiler-cache-restore.outputs.cache-hit }}
if: ${{ steps.compiler-cache-restore.outputs.cache-hit && github.event_name == 'push' }}
continue-on-error: true
run: |
gh extension install actions/gh-actions-cache
Expand All @@ -132,6 +132,9 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Save Compiler Cache"
uses: actions/cache/save@v4
# Updating th cache doesn't work from forks
# So update it once it's merged into the repo
if: ${{ github.event_name == 'push' }}
with:
path: ${{ matrix.compiler_cache_path }}
key: ${{ matrix.os }}_compiler_cache

0 comments on commit 146227a

Please sign in to comment.