Delete old branches #204
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: Delete old branches | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
cleanup_old_branches: | |
runs-on: ubuntu-latest | |
if: github.repository == 'wolfi-dev/advisories' | |
permissions: | |
id-token: write | |
steps: | |
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
with: | |
egress-policy: audit | |
- uses: octo-sts/action@6177b4481c00308b3839969c3eca88c96a91775f # v1.0.0 | |
id: octo-sts | |
with: | |
scope: ${{ github.repository }} | |
identity: delete-branches | |
# this need to point to main to always get the latest action | |
- uses: wolfi-dev/actions/install-wolfictl@main # main | |
- name: Delete Branches that matches adv- | |
run: | | |
wolfictl gh gc branch https://github.com/wolfi-dev/advisories --match "adv-" | |
env: | |
GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }} |