Skip to content

Commit 46c8b22

Browse files
committed
add logic for creating new release branch
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
1 parent 2b65746 commit 46c8b22

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

make-release.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,30 @@ commitChanges() {
102102
# with the name release-vX
103103
## This func will be used when we have a new major release and there is no branch in the upstream repo
104104
createNewReleaseBranch(){
105-
git checkout -b "${RELEASE_BRANCH}"
105+
git checkout -b "${RELEASE_BRANCH}" main
106106
git push origin "${RELEASE_BRANCH}"
107-
hub sync
107+
#hub sync
108108
}
109109

110110
createPullRequest(){
111111
echo "[INFO] Creating a PR"
112-
hub pull-request --base ${RELEASE_BRANCH} --head ${SCHEMA_VERSION} -m "$1"
112+
hub pull-request --base jdubrick:${RELEASE_BRANCH} --head ${SCHEMA_VERSION} -m "$1"
113113
}
114114

115115
main(){
116-
checkoutToReleaseBranch
117-
updateVersionNumbers
118-
exportEnvironmentVariables
119-
make bundle
120-
commitChanges "chore(release): release version ${SCHEMA_VERSION}"
121-
createPullRequest "v${SCHEMA_VERSION} Release"
116+
# checkoutToReleaseBranch
117+
# updateVersionNumbers
118+
# exportEnvironmentVariables
119+
# make bundle
120+
# commitChanges "chore(release): release version ${SCHEMA_VERSION}"
121+
#createPullRequest "v${SCHEMA_VERSION} Release"
122+
# Check if the branch exists in the remote repository
123+
if git ls-remote --exit-code --heads origin "$RELEASE_BRANCH" >/dev/null 2>&1; then
124+
echo "Branch $RELEASE_BRANCH exists in the remote repository."
125+
else
126+
echo "Branch $RELEASE_BRANCH does not exist in the remote repository."
127+
createNewReleaseBranch
128+
fi
122129
}
123130

124131
main

0 commit comments

Comments
 (0)