@@ -68,6 +68,17 @@ main() {
68
68
exit
69
69
fi
70
70
71
+ # Note: we need to set upstream as well or the gh pr create step will fail
72
+ # See: https://github.com/cli/cli/issues/575
73
+ CURRENT_BRANCH=$( git branch | grep ' \*' | cut -d' ' -f2-)
74
+ if [[ -z $( git config " branch.${CURRENT_BRANCH} .remote" ) ]]; then
75
+ echo " Doesn't look like you've pushed this branch to remote"
76
+ # Note: we need to set upstream as well or the gh pr create step will fail
77
+ # See: https://github.com/cli/cli/issues/575
78
+ echo " Please set the upstream and then run the script"
79
+ exit 1
80
+ fi
81
+
71
82
# credit to jakwuh for this solution
72
83
# https://gist.github.com/DarrenN/8c6a5b969481725a4413#gistcomment-1971123
73
84
CODE_SERVER_CURRENT_VERSION=$( node -pe " require('./package.json').version" )
@@ -90,18 +101,6 @@ main() {
90
101
91
102
$CMD git commit -am " chore(release): bump version to $CODE_SERVER_VERSION_TO_UPDATE "
92
103
93
- # Note: we need to set upstream as well or the gh pr create step will fail
94
- # See: https://github.com/cli/cli/issues/575
95
- CURRENT_BRANCH=$( git branch | grep ' \*' | cut -d' ' -f2-)
96
- if [[ -z $( git config " branch.${CURRENT_BRANCH} .remote" ) ]]; then
97
- echo " Doesn't look like you've pushed this branch to remote"
98
- echo -e " Pushing now using: git push origin $CURRENT_BRANCH \n"
99
- # Note: we need to set upstream as well or the gh pr create step will fail
100
- # See: https://github.com/cli/cli/issues/575
101
- echo " Please set the upstream and re-run the script"
102
- exit 1
103
- fi
104
-
105
104
# This runs from the root so that's why we use this path vs. ../../
106
105
RELEASE_TEMPLATE_STRING=$( cat ./.github/PULL_REQUEST_TEMPLATE/release_template.md)
107
106
0 commit comments