feat: Update project version and add Codecov integration #5
Workflow file for this run
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: Cache Cleanup | |
on: | |
pull_request: | |
types: | |
- closed | |
workflow_dispatch: | |
jobs: | |
cleanup_pr: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cleanup PR Cache | |
run: | | |
gh extension install actions/gh-actions-cache | |
echo "Fetching list of cache keys" | |
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) | |
## Setting this to not fail the workflow while deleting cache keys. | |
set +e | |
echo "Deleting caches..." | |
for cacheKey in $cacheKeysForPR | |
do | |
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm | |
done | |
echo "Done" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPO: ${{ github.repository }} | |
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge | |
cleanup_all: | |
if: github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cleanup All Caches | |
run: | | |
gh extension install actions/gh-actions-cache | |
echo "Fetching list of all cache keys" | |
allCacheKeys=$(gh actions-cache list -R $REPO | cut -f 1) | |
## Setting this to not fail the workflow while deleting cache keys. | |
set +e | |
echo "Deleting all caches..." | |
for cacheKey in $allCacheKeys | |
do | |
gh actions-cache delete $cacheKey -R $REPO --confirm | |
done | |
echo "Done" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPO: ${{ github.repository }} |