Skip to content

Commit

Permalink
fix: added cleanup-branch-cache permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
prisis committed May 20, 2024
1 parent 039e0d3 commit 2a834c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions workflow/cleanup-branch-cache.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# From https://github.com/actions/cache/blob/main/tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy
name: "Cleanup caches by a branch"

on: # yamllint disable-line rule:truthy
Expand All @@ -11,6 +12,11 @@ jobs:
cleanup:
if: "github.repository == inputs.target-repo"
runs-on: "ubuntu-latest"
permissions:
# `actions:write` permission is required to delete caches
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
actions: write
contents: read
steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142" # v2.7.0
Expand Down

0 comments on commit 2a834c8

Please sign in to comment.