From 681a983b0230da832bb9ecbb4eb8570e56f4c312 Mon Sep 17 00:00:00 2001 From: Nara Kasbergen Kwon <855115+xiehan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:18:53 +0200 Subject: [PATCH] chore: further improve branch cleanup script [skip ci] --- .github/workflows/delete-old-branches.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/delete-old-branches.yml b/.github/workflows/delete-old-branches.yml index 802d29e..e4b713f 100644 --- a/.github/workflows/delete-old-branches.yml +++ b/.github/workflows/delete-old-branches.yml @@ -33,8 +33,21 @@ jobs: run: |- git config user.name "team-tf-cdk" git config user.email "github-team-tf-cdk@hashicorp.com" - - name: Delete old branches from previous runs - run: | - git branch -r | egrep -o "upgrade-provider-project.*" | xargs -n 1 git push origin --delete - git branch -r | egrep -o "cdktf-next-pr.*" | xargs -n 1 git push origin --delete + - name: Delete old branches from previous repo-manager runs + run: git branch -r | egrep -o "upgrade-provider-project.*" | xargs -n 1 git push origin --delete + continue-on-error: true # don't fail the run if these branches never existed + - name: Delete old branches from when we used to build providers against cdktf@next + run: git branch -r | egrep -o "cdktf-next-pr.*" | xargs -n 1 git push origin --delete + continue-on-error: true # don't fail the run if these branches never existed + - name: Delete old renovate branches that were never used + run: git branch -r | egrep -o ".*renovate.*" | xargs -n 1 git push origin --delete + continue-on-error: true # don't fail the run if these branches never existed + - name: Delete old update-main branch that has not been used in 3 years + run: git branch -r | egrep -o "update-main" | xargs -n 1 git push origin --delete + continue-on-error: true # don't fail the run if these branches never existed + - name: Delete old Projen branch name convention that has not been used in 3 years # the one we use nowadays is github-actions/upgrade-main + run: git branch -r | egrep -o "github-actions/upgrade" | xargs -n 1 git push origin --delete + continue-on-error: true # don't fail the run if these branches never existed + - name: Delete another Projen branch name convention that has not been used in 3 years + run: git branch -r | egrep -o "github-actions/upgrade-dependencies" | xargs -n 1 git push origin --delete continue-on-error: true # don't fail the run if these branches never existed