github/ci: Check if backport is opened against the expected branch#47647
github/ci: Check if backport is opened against the expected branch#47647thaJeztah merged 1 commit intomoby:masterfrom
Conversation
fb6a8f6 to
2219548
Compare
2219548 to
8836380
Compare
|
Left those comments; perhaps no "blockers", but as we're planning to cherry-pick this to various branches, let me know if you think they make sense (could safe time if we can cherry-pick all at once, instead of follow-up backports) |
There was a problem hiding this comment.
LGTM!
If we want to make this logic more readable in follow-up we could switch to https://github.com/actions/github-script and handle step context by its outcome to display an error message: https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context
Also we could move this job to a reusable workflow so we would cancel all workflows at once like we do with dco: https://github.com/moby/moby/blob/master/.github/workflows/.dco.yml
see
moby/.github/workflows/buildkit.yml
Lines 20 to 21 in 330a6f9
8836380 to
e533fec
Compare
c8b6a97 to
c2448e9
Compare
That would mean duplicating the PR checks for every workflow though? There's also no need to re-run the PR checks with every force-push, as it only checks the PR description/labels. It only triggers on PR edits. Unless we can keep the |
c2448e9 to
d6dd445
Compare
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
d6dd445 to
61269e7
Compare
- What I did
Added a GHA check for the expected target branch on backport PRs.
- How to verify it
CI: https://github.com/moby/moby/actions/runs/8466474413/job/23195302313?pr=47647
Tested with this PR titled as
[1337.0 backport] github/ci: Check if backport is opened against the expected branch- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)