INFRA-2867: Skip version bump PR creation if already exists, commit in main#112
Merged
Merged
Conversation
|
|
||
| # If the version bump branch has no commits ahead of main, skip pushing/PR creation | ||
| # right-only count gives number of commits unique to the version bump branch | ||
| ahead_count=$(git rev-list --right-only --count "${main_branch}...${version_bump_branch_name}" || echo 0) |
Contributor
There was a problem hiding this comment.
Why do we fallback to echo 0 here?
If git rev-list fails (e.g. due to a bad ref), this would set ahead_count=0 and the script would continue.
It seems to me that could result in hiding unexpected errors? (which I don't think we should)
Contributor
Author
There was a problem hiding this comment.
Ah, if we want to keep errors here. Then I updated the code so that after you merge the previous version-bump PR, re-running the workflow will no-op the new version-bump PR step instead of failing.
…n main Signed-off-by: Pavel Dvorkin <pavel.dvorkin@consensys.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: https://consensyssoftware.atlassian.net/browse/INFRA-2867
Skip version bump PR creation if already exists, commit in main
Error reproduced here
Fix tested here: https://github.com/consensys-test/metamask-extension-test-workflow2/actions/runs/17276145574/job/49033208400