-
Notifications
You must be signed in to change notification settings - Fork 35
37 lines (35 loc) · 1.04 KB
/
clear-cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: clear-cache
on:
workflow_dispatch:
workflow_call:
jobs:
clear-cache:
runs-on: ubuntu-latest
steps:
- name: Clear ccache
uses: actions/github-script@v7
with:
script: |
console.log("Getting action cache")
const parameters = {
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100,
direction: "asc",
sort: "created_at",
}
const caches = await github.paginate(
github.rest.actions.getActionsCacheList,
parameters,
(response) => response.data,
)
for (const cache of caches) {
if (cache.key.startsWith("ccache-")) {
console.log("Deleting cache entry", cache)
github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
})
}
}