Skip to content

Commit 1174ad2

Browse files
committed
Delete caches associated with a branch after it has been merged into main
1 parent b9f7024 commit 1174ad2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Delete Unused Caches
2+
3+
on:
4+
pull_request:
5+
types: [ closed ]
6+
7+
jobs:
8+
9+
# This deletes the caches created by the branch while it was in PR.
10+
# Those caches are inaccessible to it once it's merged, so they can be deleted.
11+
delete-orphaned-caches:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: snnaplab/delete-branch-cache-action@v1
15+
with:
16+
# Specify explicitly because the ref at the time of merging
17+
# will be a branch name such as 'main', 'develop'
18+
ref: refs/pull/${{ github.event.number }}/merge

0 commit comments

Comments
 (0)