Skip to content

Commit

Permalink
chore: merge forward script fails when branch is already checked out (#…
Browse files Browse the repository at this point in the history
…10946)

The [AutoPullRequest] CodeBuild job already checks out the base branch.
This causes the `git checkout -b` command to fail since the branch
already exists.

Update the script so that branch creation occurs only if it does not
already exist.

[AutoPullRequest]: https://github.com/aws/cdk-ops/blob/21acd7ff37ad9ab14d8c3f9b41980e9f62f64503/lib/cdk-pipeline.ts#L284-L290


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Niranjan Jayakar authored Oct 19, 2020
1 parent 62a2286 commit ddff37c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/merge-forward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
set -exo pipefail

git fetch --all
git checkout -b v2-main origin/v2-main
git merge origin/master --no-edit
git checkout -B v2-main origin/v2-main
git merge origin/master --no-edit

0 comments on commit ddff37c

Please sign in to comment.