aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2023-05-28 09:11:29 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2023-10-24 17:12:05 +0200
commit5bfa66bcf3bfcadea059bae1f1d18b388318caa4 (patch)
treef96b38b98fb8ead17cc502711cd2e5894f45360d
parent15f4d6b2441e47ed63df961c43515cba11da3a7b (diff)
downloadupstream-5bfa66bcf3bfcadea059bae1f1d18b388318caa4.tar.gz
upstream-5bfa66bcf3bfcadea059bae1f1d18b388318caa4.tar.bz2
upstream-5bfa66bcf3bfcadea059bae1f1d18b388318caa4.zip
CI: build: limit cache save/delete only on push events
Limit ccache cache save/delete only on push events. Saving ccache cache for pull request will result in bloat and refreshing ccache is not possible due to security measure on enforcing read permission on pull_request events. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commit ff66a7c1c0f012324c0d2d90f047e6976c4fba11)
-rw-r--r--.github/workflows/build.yml4
1 files changed, 2 insertions, 2 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0c0c05f402..95d19f4c4e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -498,7 +498,7 @@ jobs:
path: "openwrt/logs"
- name: Delete already present ccache cache
- if: steps.restore-ccache-cache.outputs.cache-hit == 'true' && inputs.use_ccache_cache == true
+ if: steps.restore-ccache-cache.outputs.cache-hit == 'true' && inputs.use_ccache_cache == true && github.event_name == 'push'
uses: octokit/request-action@v2.x
with:
route: DELETE /repos/{repository}/actions/caches?key={key}
@@ -508,7 +508,7 @@ jobs:
INPUT_KEY: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }}
- name: Save ccache cache
- if: inputs.use_ccache_cache == true
+ if: inputs.use_ccache_cache == true && github.event_name == 'push'
uses: actions/cache/save@v3
with:
path: openwrt/.ccache