Skip to content

Commit

Permalink
Merge pull request #554 from nimblehq/feature/524-add-workflow-to-cle…
Browse files Browse the repository at this point in the history
…ar-github-action-cache

[#524] Add workflow to clear GitHub action cache
  • Loading branch information
nkhanh44 authored Jun 24, 2024
2 parents 36cd772 + 7102bcc commit 7bf00ff
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/cleanup_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Cleanup Cache
on:
pull_request:
types:
- closed

jobs:
cleanup_cache:
runs-on: macOS-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- 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 -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/test_swiftui_install_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
jobs:
Test:
name: Test
runs-on: macOS-12
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion fastlane/Constants/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ enum Constant {

// MARK: - Device

static let devices = ["iPhone 12 Pro Max"]
static let devices = ["iPhone 15 Pro"]
}

extension Constant {
Expand Down

0 comments on commit 7bf00ff

Please sign in to comment.