Skip to content

Commit e13dc70

Browse files
committed
fix(update-aws-cdk): Ensure a valid git branch name
Remove invalid `^` character from branch name as described in the spec - https://git-scm.com/docs/git-check-ref-format. See also #2698.
1 parent 6ed63be commit e13dc70

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

script/update-aws-cdk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,17 @@ raisePR() {
5151
AWSCDKLIB_VERSION=$(jq -r '.peerDependencies."aws-cdk-lib"' < "$ROOT_DIR/package.json")
5252
CONSTRUCT_VERSION=$(jq -r '.peerDependencies.constructs' < "$ROOT_DIR/package.json")
5353

54-
BRANCH_NAME="update-aws-cdk-$AWSCDK_VERSION"
54+
AWSCDK_VERSION_CLEANED=$(
55+
echo "$AWSCDK_VERSION" \
56+
| sed 's/\^//g' # Remove ^ to ensure a valid branch name. See https://git-scm.com/docs/git-check-ref-format.
57+
)
58+
59+
BRANCH_NAME="update-aws-cdk-$AWSCDK_VERSION_CLEANED"
60+
5561
COMMIT_SUBJECT="fix(deps): Update AWS CDK libraries to $AWSCDK_VERSION, and constructs to $CONSTRUCT_VERSION"
5662
COMMIT_BODY="Update aws-cdk to $AWSCDK_VERSION, aws-cdk-lib to $AWSCDKLIB_VERSION, constructs to $CONSTRUCT_VERSION"
5763

58-
addChangeset "$AWSCDK_VERSION" "$COMMIT_BODY"
64+
addChangeset "$AWSCDK_VERSION_CLEANED" "$COMMIT_BODY"
5965

6066
git checkout -b "$BRANCH_NAME"
6167

0 commit comments

Comments
 (0)