Prune merged branches #107
This file contains hidden or 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
| # Copyright (c) Meta Platforms, Inc. and affiliates. | |
| # Prune remote branches whose PRs are merged/closed, plus stale branches | |
| # with no PR older than 60 days. | |
| name: Prune merged branches | |
| on: | |
| schedule: | |
| - cron: "0 6 * * *" # daily at 6am UTC | |
| workflow_dispatch: # manual trigger | |
| permissions: {} | |
| jobs: | |
| prune: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 # full history needed for commit date checks | |
| - name: Prune branches | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: ./scripts/prune-branches.sh --delete |