Skip to content

Commit 4e62629

Browse files
Merge pull request openshift#452 from xiaoyu74/update_ci_release_script
[OSD-20658] Updated the ci-release script to ensure remote upstream repo is added
2 parents 6075bc8 + 66fb498 commit 4e62629

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ci-release.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/bash
2+
# Manual release steps for reference: https://github.com/openshift/backplane-cli/blob/main/docs/release.md
3+
24
set -e
35

6+
REPO_URL="https://github.com/openshift/backplane-cli.git"
7+
48
# Extract version from VERSION.md
59
VERSION=$(grep 'Version:' VERSION.md | awk '{print $2}')
610

@@ -20,6 +24,16 @@ fi
2024
git config user.name "CI release"
2125
git config user.email "ci-test@release.com"
2226

27+
# Ensure the remote repository 'upstream' is set to the correct URL
28+
if git remote | grep -iq 'upstream'; then
29+
current_url=$(git remote get-url upstream)
30+
if [ "$current_url" != "$REPO_URL" ]; then
31+
git remote set-url upstream $REPO_URL
32+
fi
33+
else
34+
git remote add upstream $REPO_URL
35+
fi
36+
2337
# Ensure working on the latest main
2438
git fetch upstream
2539
git checkout upstream/main

0 commit comments

Comments
 (0)