From f096915c274354be1b9a62d03a81ecbdf30a6991 Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Sat, 4 Feb 2023 15:18:11 -0600 Subject: [PATCH] chore(ci): automatically delete stale branches (#6036) --- .github/workflows/stale.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 25b70e0f6b..192f298523 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -1,11 +1,11 @@ -name: Stale Issue Cron +name: Stale Issue and Branch Cleanup on: schedule: # Every day at midnight - cron: "0 0 * * *" workflow_dispatch: jobs: - stale: + issues: runs-on: ubuntu-latest permissions: issues: write @@ -32,3 +32,17 @@ jobs: operations-per-run: 60 # Start with the oldest issues, always. ascending: true + branches: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Run delete-old-branches-action + uses: beatlabs/delete-old-branches-action@v0.0.9 + with: + repo_token: ${{ github.token }} + date: "6 months ago" + dry_run: false + delete_tags: false + # extra_protected_branch_regex: ^(foo|bar)$ + exclude_open_pr_branches: true