Skip to content

Commit

Permalink
fix: check if tag exists on remote before... (#1230)
Browse files Browse the repository at this point in the history
* fix: check if tag exists on remote before attempting to delete it

Change-Id: Ibf0021ef56d5d1f18fc9e1181ea6029b6a694738
Signed-off-by: nickboldt <nboldt@redhat.com>

* fix: check if local tag exists before deleting it

Change-Id: I632914e164fd122e2cbede4650fc919fc1b7c6fc
Signed-off-by: nickboldt <nboldt@redhat.com>

remove or-true

Change-Id: I292eeb5787d2174a0f158895755194fbc837fef2
Signed-off-by: nickboldt <nboldt@redhat.com>

don't grep, just use explicit pattern (avoid 7.40.0-release)

Change-Id: Ied835ac42c5f15ca8a138eda6eb56a51badb382a
Signed-off-by: nickboldt <nboldt@redhat.com>
  • Loading branch information
nickboldt authored Dec 6, 2021
1 parent b4511e3 commit 8febb40
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,17 @@ pushGitChanges() {
echo "[INFO] Push git changes into $RELEASE_BRANCH branch"
git push origin $RELEASE_BRANCH ${FORCE_UPDATE}
if [[ $FORCE_UPDATE == "--force" ]]; then # if forced update, delete existing tag so we can replace it
if git rev-parse "$RELEASE" >/dev/null 2>&1; then # if tag exists
if [[ $(git tag -l $RELEASE) ]]; then # if tag exists in local repo
echo "Remove existing local tag $RELEASE"
git tag -d $RELEASE
else
echo "Local tag $RELEASE does not exist" # should never get here
fi
if [[ $(git ls-remote --tags $(git remote get-url origin) $RELEASE) ]]; then # if tag exists in remote repo
echo "Remove existing remote tag $RELEASE"
git push origin :$RELEASE
else
echo "Remote tag $RELEASE does not exist" # should never get here
fi
fi
git tag -a $RELEASE -m $RELEASE
Expand Down

0 comments on commit 8febb40

Please sign in to comment.