Skip to content

Commit 3282fd5

Browse files
committed
cleanup branch
1 parent 40f7920 commit 3282fd5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/AutoUpdateBootstrap.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ jobs:
9191
git config --global user.email "github-aws-sdk-dotnet-automation@amazon.com"
9292
git config --global user.name "aws-sdk-dotnet-automation"
9393
94+
- name: Delete existing branch if it exists
95+
if: steps.check_version.outputs.version_changed == 'true'
96+
env:
97+
GITHUB_TOKEN: ${{ env.AWS_SECRET_TOKEN }}
98+
run: |
99+
# Check if branch exists and delete it if it does
100+
if git ls-remote --heads origin update-cdk-bootstrap-template | grep -q update-cdk-bootstrap-template; then
101+
git push origin --delete update-cdk-bootstrap-template || true
102+
fi
103+
94104
- name: Create Pull Request
95105
if: steps.check_version.outputs.version_changed == 'true'
96106
env:
@@ -104,4 +114,4 @@ jobs:
104114
--title "Update CDK Bootstrap Template to Version ${{ steps.check_version.outputs.new_version }}" \
105115
--base dev \
106116
--head update-cdk-bootstrap-template \
107-
--delete-branch
117+
--fill

0 commit comments

Comments
 (0)