-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[27.1 backport] gha: check-pr-branch: verify major version only #5263
Conversation
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 |
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 😄 |
Yeah; it's fiddly; I should probably disable all the other actions as well for debugging |
.github/workflows/validate-pr.yml
Outdated
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]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
[[ "$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 <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 6d8fcbb) Signed-off-by: Sebastiaan van Stijn <[email protected]>
487171e
to
f7be714
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.
(cherry picked from commit 45f769d)