Skip to content

Commit 54fad45

Browse files
authored
Merge pull request #120 from dorssel/delete_cache
Fix delete cache
2 parents b8fb4c8 + 4a00611 commit 54fad45

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/actions/save-runtime-cache/action.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,23 @@ runs:
2626
- id: delete
2727
if: ${{ steps.lookup-runtime-cache.outputs.cache-hit }}
2828
uses: actions/github-script@v7
29+
env:
30+
RUNTIME_CACHE_KEY: ${{ steps.lookup-runtime-cache.outputs.key }}
2931
with:
3032
script: |
31-
github.rest.actions.deleteActionsCacheById({
33+
const { RUNTIME_CACHE_KEY } = process.env
34+
const runtime_caches = await github.rest.actions.getActionsCacheList({
3235
owner: context.repo.owner,
3336
repo: context.repo.repo,
34-
cache_id: steps.lookup-runtime-cache.outputs.key,
37+
key: `${RUNTIME_CACHE_KEY}`,
3538
})
39+
for (const runtime_cache of runtime_caches.data.actions_caches) {
40+
github.rest.actions.deleteActionsCacheById({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
cache_id: runtime_cache.id,
44+
})
45+
}
3646
3747
- id: save
3848
uses: actions/cache/save@v4

0 commit comments

Comments
 (0)