diff --git a/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md b/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md index 708aff00624a..ec563bd0e172 100644 --- a/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md +++ b/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md @@ -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 ) @@ -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)."