Skip to content

Prune merged branches #107

Prune merged branches

Prune merged branches #107

# 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