Skip to content

ci(deps): bump the github-actions group with 4 updates #480

ci(deps): bump the github-actions group with 4 updates

ci(deps): bump the github-actions group with 4 updates #480

---
name: Cleanup Pull Request Images
on:
pull_request:
types: [closed]
permissions: {}
env:
REGISTRY: ghcr.io
jobs:
delete-images:
runs-on: ubuntu-latest
strategy:
matrix:
flavor: ["cpp", "rust"]
permissions:
packages: write
steps:
- uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
with:
egress-policy: audit
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: bots-house/ghcr-delete-image-action@3827559c68cb4dcdf54d813ea9853be6d468d3a4 # v1.1.0
with:
owner: ${{ github.repository_owner }}
name: ${{ github.event.repository.name }}-${{ matrix.flavor }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: pr-${{ github.event.pull_request.number }}
cleanup-cache:
runs-on: ubuntu-latest
permissions:
# actions: write permission is required to delete the cache
actions: write
steps:
- uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
with:
egress-policy: audit
- run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
## Setting this to not fail the workflow while deleting cache keys.
set +e
for cacheKey in $(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1)
do
gh actions-cache delete "$cacheKey" -R $REPO -B $BRANCH --confirm
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}