File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,13 @@ VERSION_SHA=$(git blame -- package.json | grep '"version":' | cut -d' ' -f1)
27
27
VERSION=$( jq -r .version package.json)
28
28
29
29
# Create a new branch with the changes to release
30
- git switch -c " $BRANCH " " $VERSION_SHA "
31
- git push origin HEAD
30
+ git branch " $BRANCH " " $VERSION_SHA "
31
+ git push -u origin " $BRANCH "
32
+ git branch -D " $BRANCH "
33
+
32
34
33
35
if ! which gh > /dev/null; then
34
36
# GitHub CLI not installed - clean up and prompt for manual branch creation
35
- git switch " $BASE_BRANCH "
36
- git branch -D " $BRANCH "
37
37
echo " Open a PR: https://github.com/salesforce/lwc/pull/new/$BRANCH "
38
38
exit 0
39
39
fi
@@ -44,14 +44,11 @@ if [ -n "$WORK_ITEM" ]; then
44
44
fi
45
45
# Use GitHub CLI to create a PR and wait for CI checks to pass
46
46
gh pr create -t " $PR_TITLE " -b ' ' -B " $RELEASE_BRANCH " -H " $BRANCH "
47
- # Clean up locally
48
- git switch " $BASE_BRANCH "
49
- git branch -D " $BRANCH "
50
47
51
48
# Wait for CI to complete
52
49
sleep 3 # Give GitHub time to kick off CI
53
50
. " $( dirname " $0 " ) /wait-for-pr.sh" " $BRANCH "
54
- if ! gh pr checks --fail-fast --watch; then
51
+ if ! gh pr checks " $BRANCH " --fail-fast --watch; then
55
52
echo ' CI failed. Cannot continue with release.'
56
53
gh pr view " $BRANCH " --web
57
54
exit 1
Original file line number Diff line number Diff line change @@ -44,8 +44,10 @@ if ! gh >/dev/null; then
44
44
fi
45
45
46
46
# Use GitHub CLI to create a PR and wait for it to be merged before exiting
47
- gh pr create -t " $VERSION_BUMP_MESSAGE " -b ' '
48
- gh pr merge --auto --squash --delete-branch
47
+ gh pr create -t " $VERSION_BUMP_MESSAGE " -b ' ' -B " $BASE_BRANCH " -H " $BRANCH "
48
+ # Squash on master, but not backports
49
+ [ " $BASE_BRANCH " == ' master' ] && SQUASH=' --squash'
50
+ gh pr merge --auto --delete-branch $SQUASH
49
51
git switch " $BASE_BRANCH "
50
52
git branch -D " $BRANCH "
51
53
You can’t perform that action at this time.
0 commit comments