Skip to content

Commit

Permalink
fix(ci): Update cache job fix (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa-tomic committed Sep 5, 2024
1 parent 4da9d59 commit 6f46268
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/manage-runner-post/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,6 @@ runs:
# Cache is saved on main only to avoid cache evictions due to github restrictions:
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
########################################
- name: First delete cache entry if it exists
if: ${{ github.ref == 'refs/heads/main' }}
run: |
set -eExou pipefail
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=${{ github.ref }}
echo "Fetching list of cache key"
cacheKeys=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
echo "Deleting caches..."
for cacheKey in $cacheKeys
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm || true
done
echo "Done"
env:
GH_TOKEN: ${{ inputs.GITHUB_TOKEN }}
shell: bash
- name: "☁️ ⬆️ Saving cache on main only"
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/cache/save@v4
Expand Down

0 comments on commit 6f46268

Please sign in to comment.