Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,11 @@ on:
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: {% data reusables.actions.action-checkout %}

steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache

REPO={% raw %}${{ github.repository }}{% endraw %}
BRANCH="refs/pull/{% raw %}${{ github.event.pull_request.number }}{% endraw %}/merge"

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )

Expand All @@ -368,6 +362,8 @@ jobs:
echo "Done"
env:
GH_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
REPO: {% raw %}${{ github.repository }}{% endraw %}
BRANCH: refs/pull/{% raw %}${{ github.event.pull_request.number }}{% endraw %}/merge
```

Alternatively, you can use the API to automatically list or delete all caches on your own cadence. For more information, see "[AUTOTITLE](/rest/actions/cache#about-the-cache-in-github-actions)."
Expand Down