Skip to content

Commit

Permalink
ci: pin workflow action versions (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7061 authored Feb 20, 2025
2 parents 48bb81b + 73cf5f5 commit 27a1d73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
32 changes: 4 additions & 28 deletions .github/workflows/cleanup-cache.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
name: cleanup caches by a branch
name: cache
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
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 }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
cache_cleanup:
name: Clean up cache
uses: evva-sfw/workflows/.github/workflows/call_cache.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
key: node-modules
- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
Expand Down

0 comments on commit 27a1d73

Please sign in to comment.