Skip to content

Clear caches

Clear caches #4

Workflow file for this run

name: Clear caches
on:
workflow_dispatch:
permissions:
actions: write
jobs:
clear-cache:
runs-on: ubuntu-latest
steps:
- name: Clear caches
uses: actions/github-script@v7
with:
script: |
const caches = await github.paginate(
github.rest.actions.getActionsCacheList.endpoint.merge({
owner: context.repo.owner,
repo: context.repo.repo,
})
)
for (const cache of caches) {
console.log(cache)
github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
})
}