From 020b87e91b55daeb8612462527b87a3d82fb5f29 Mon Sep 17 00:00:00 2001 From: Kevin Minehart <5140827+kminehart@users.noreply.github.com> Date: Wed, 24 Sep 2025 15:53:37 -0500 Subject: [PATCH] CI: Add cleanup branches cronjob (with dry-run: true) (#111428) * CI: Add cleanup branches cronjob (with dry-run: true) * update codeowners --- .github/CODEOWNERS | 1 + .github/workflows/cleanup-branches.yml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .github/workflows/cleanup-branches.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c76673efd98..85db1f8d4c7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1262,6 +1262,7 @@ embed.go @grafana/grafana-as-code /.github/workflows/changelog.yml @zserge /.github/workflows/shellcheck.yml @grafana/grafana-developer-enablement-squad /.github/workflows/release-build.yml @grafana/grafana-developer-enablement-squad +/.github/workflows/cleanup-branches.yml @grafana/grafana-developer-enablement-squad /.github/workflows/publish-artifact.yml @grafana/grafana-developer-enablement-squad /.github/actions/changelog @zserge /.github/workflows/swagger-gen.yml @grafana/grafana-backend-group diff --git a/.github/workflows/cleanup-branches.yml b/.github/workflows/cleanup-branches.yml new file mode 100644 index 00000000000..00cb4f26541 --- /dev/null +++ b/.github/workflows/cleanup-branches.yml @@ -0,0 +1,18 @@ +name: Clean up orphaned branches +on: + workflow_dispatch: + schedule: + - cron: "0 9 * * 1" + +jobs: + cleanup-branches: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - uses: actions/checkout@v5 + - uses: grafana/shared-workflows/actions/cleanup-branches@cleanup-branches/v1.0.0 + with: + dry-run: true + max-date: "1 month ago"