[27.1 backport] gha: check-pr-branch: verify major version only#5263
Merged
Conversation
Member
Author
|
moving to draft; looks like this latest variant doesn't work; moby/moby#48191 (comment) |
b30b80e to
2a65aec
Compare
2a65aec to
342ce3e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 27.0 #5263 +/- ##
==========================================
+ Coverage 61.45% 61.50% +0.04%
==========================================
Files 296 299 +3
Lines 20828 20833 +5
==========================================
+ Hits 12800 12813 +13
+ Misses 7115 7110 -5
+ Partials 913 910 -3 |
Collaborator
|
Just noticed you added a debug commit to print env. You probably remember about that, but just in case you forgot: the PR needs a title/description change for that workflow to be triggered 😄 |
Member
Author
|
Yeah; it's fiddly; I should probably disable all the other actions as well for debugging |
thaJeztah
commented
Jul 19, 2024
| if: github.event.pull_request.base.ref != steps.title_branch.outputs.branch && !(github.event.pull_request.base.ref == 'master' && steps.title_branch.outputs.branch == '') | ||
| run: echo "::error::PR title suggests targetting the ${{ steps.title_branch.outputs.branch }} branch, but is opened against ${{ github.event.pull_request.base.ref }}" && exit 1 | ||
| # get major version prefix from the release branch ("27.x -> "27.") | ||
| [[ "$GITHUB_BASE_REF" =~ ^\([0-9]*\.\) ]] && target_branch="${BASH_REMATCH[1]}" |
Member
Author
There was a problem hiding this comment.
AH! This was meant to be a capturing group, but I think Cory kept the sed syntax, so it's now escaped; this should be
Suggested change
| [[ "$GITHUB_BASE_REF" =~ ^\([0-9]*\.\) ]] && target_branch="${BASH_REMATCH[1]}" | |
| [[ "$GITHUB_BASE_REF" =~ ^([0-9]*\.) ]] && target_branch="${BASH_REMATCH[1]}" |
ec964e4 to
487171e
Compare
We'll be using release branches for minor version updates, so instead of (e.g.) a 27.0 branch, we'll be using 27.x and continue using the branch for minor version updates. This patch changes the validation step to only compare against the major version. Co-authored-by: Cory Snider <corhere@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 6d8fcbb) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
487171e to
f7be714
Compare
vvoland
approved these changes
Jul 19, 2024
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.
We'll be using release branches for minor version updates, so instead of (e.g.) a 27.0 branch, we'll be using 27.x and continue using the branch for minor version updates.
This patch changes the validation step to only compare against the major version.
(cherry picked from commit 45f769d)