Skip to content

Commit 52ba1b1

Browse files
committed
added ci clear cache
1 parent 46d0601 commit 52ba1b1

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/cache.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Clear cache
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
actions: write
8+
9+
jobs:
10+
clear-cache:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Clear cache
14+
uses: actions/github-script@v7
15+
with:
16+
script: |
17+
console.log("About to clear")
18+
const caches = await github.rest.actions.getActionsCacheList({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
})
22+
for (const cache of caches.data.actions_caches) {
23+
console.log(cache)
24+
github.rest.actions.deleteActionsCacheById({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
cache_id: cache.id,
28+
})
29+
}
30+
console.log("Clear completed")

0 commit comments

Comments
 (0)