From c727528b6fb001f04d311de7b6d7f1be0b08b5cd Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 28 Sep 2024 23:44:22 +0300 Subject: [PATCH] CI: clean up stale branches periodically --- .github/workflows/cleanup.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/cleanup.yml diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 00000000..204dcba7 --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -0,0 +1,22 @@ +name: Cleanup +on: + workflow_dispatch: + schedule: + - cron: "0 4 1 * *" # 4AM on 1st of every month + - cron: "0 4 15 * *" # 4AM on the 15th of every month +jobs: + branches: + name: Cleanup old branches + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: "Delete old branches" + uses: beatlabs/delete-old-branches-action@v0.0.10 + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + date: "1 months ago" + dry_run: false + delete_tags: false + exclude_open_pr_branches: true