Skip to content

Commit

Permalink
Merge branch 'develop' into byk/feat/SENTRY_SPOTLIGHT
Browse files Browse the repository at this point in the history
  • Loading branch information
BYK authored Aug 13, 2024
2 parents 7dcaa82 + 479668b commit 3a674c2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ jobs:
with:
path: ${{ github.workspace }}/packages/*/*.tgz
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
fail-on-cache-miss: true

- name: Install Playwright
uses: ./.github/actions/install-playwright
Expand Down Expand Up @@ -1076,6 +1077,7 @@ jobs:
with:
path: ${{ github.workspace }}/packages/*/*.tgz
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
fail-on-cache-miss: true

- name: Install Playwright
uses: ./.github/actions/install-playwright
Expand Down Expand Up @@ -1446,6 +1448,7 @@ jobs:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ needs.job_build.outputs.dependency_cache_key }}
enableCrossOsArchive: true
fail-on-cache-miss: true

- name: Restore build cache
uses: actions/cache/restore@v4
Expand All @@ -1454,6 +1457,7 @@ jobs:
path: ${{ env.CACHED_BUILD_PATHS }}
key: ${{ needs.job_build.outputs.dependency_cache_key }}
enableCrossOsArchive: true
fail-on-cache-miss: true

- name: Configure safe directory
run: |
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/cleanup-pr-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Automation: Cleanup PR caches"
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
# `actions:write` permission is required to delete caches
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
actions: write
contents: read
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | 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 }}

0 comments on commit 3a674c2

Please sign in to comment.