Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check if tag exists on remote before... #1230

Merged
merged 2 commits into from
Dec 6, 2021

Conversation

nickboldt
Copy link
Contributor

@nickboldt nickboldt commented Dec 6, 2021

What does this PR do?

fix: check if tag exists on remote before attempting to delete it

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

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

Fix for https://github.com/eclipse-che/che-operator/runs/4430414080?check_suite_focus=true

Switched to branch '7.40.x'
Your branch is up to date with 'origin/7.40.x'.
Switched to branch '7.40.0-release'
[INFO] Release '7.40.0' from branch '7.40.x'
[INFO] Push git changes into 7.40.0-release branch
To https://github.com/eclipse-che/che-operator
 + 842ffa16...009109c2 7.40.0-release -> 7.40.0-release (forced update)
Deleted tag '7.40.0' (was d333bfa3)
error: unable to delete '7.40.0': remote ref does not exist
error: failed to push some refs to 'https://github.com/eclipse-che/che-operator'
Error: Process completed with exit code 1.

How to test this PR?

N/A

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Change-Id: Ibf0021ef56d5d1f18fc9e1181ea6029b6a694738
Signed-off-by: nickboldt <nboldt@redhat.com>
make-release.sh Outdated
git tag -d $RELEASE
if [[ $(git ls-remote --tags $(git remote get-url origin) $RELEASE) ]]; then # if tag exists in remote repo
echo "Remove existing tag $RELEASE"
git tag -d $RELEASE || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of || true, maybe use a separate if block with $(git tag -l | grep $RELEASE)?

@nickboldt nickboldt force-pushed the better-check-if-tag-exists branch from 8c58d9e to 3b1a27f Compare December 6, 2021 14:37
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>
@nickboldt nickboldt force-pushed the better-check-if-tag-exists branch from 3b1a27f to f372f08 Compare December 6, 2021 14:39
@openshift-ci
Copy link

openshift-ci bot commented Dec 6, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mkuznyetsov, nickboldt

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the lgtm label Dec 6, 2021
@nickboldt nickboldt merged commit 8febb40 into main Dec 6, 2021
@nickboldt nickboldt deleted the better-check-if-tag-exists branch December 6, 2021 15:03
@che-bot che-bot added this to the 7.41 milestone Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants