File tree Expand file tree Collapse file tree 2 files changed +50
-1
lines changed
Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Delete Cache after PR merge
2+
3+ on :
4+ pull_request :
5+ types :
6+ - closed
7+
8+ permissions :
9+ contents : read
10+ actions : write
11+
12+ jobs :
13+ cleanup :
14+ name : Clear cache
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
20+ with :
21+ fetch-depth : 0
22+
23+ - name : Cleanup
24+ run : |
25+ gh extension install actions/gh-actions-cache
26+
27+ REPO=${{ github.repository }}
28+
29+ # get the branch
30+ BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
31+
32+ # fetch list of cache key
33+ cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
34+
35+ # set this to not fail the workflow while deleting cache keys
36+ set +e
37+
38+ # delete cache key
39+ for cacheKey in $cacheKeysForPR
40+ do
41+ gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
42+ done
43+ env :
44+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 99permissions :
1010 actions : read
1111 contents : write
12+ pull-requests : write
13+
14+ concurrency :
15+ group : publish-nuget
16+ cancel-in-progress : true
1217
1318jobs :
1419 nuget :
1520 name : Publish
16- if : ${{ github.event.workflow_run.conclusion == 'success' && github.actor != 'dependabot[bot]' }}
21+ if : ${{ github.event.workflow_run.conclusion == 'success' && github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }}
1722 uses : dailydevops/pipelines/.github/workflows/publish-nuget.yml@cb37352bc6f2f8b723d966d5d879625d3dd5413b # 1.3.13
1823 with :
1924 workflowName : ${{ github.event.workflow_run.name }}
You can’t perform that action at this time.
0 commit comments