Clear caches #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
}) | |
} | |