Skip to content

Delete old branches #548

Delete old branches

Delete old branches #548

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@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: octo-sts/action@d6c70ad3b9ac85df6da6b9749014d7283987cfec # v1.0.3
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 }}