Build Tools: Add workflow to label original PRs on manual cherry-pick…#77892
Build Tools: Add workflow to label original PRs on manual cherry-pick…#77892Sahitya3105 wants to merge 5 commits intoWordPress:trunkfrom
Conversation
WordPress#76579) When a PR is merged to a wp/* or release/* branch and its title, body, or commit message contains a cherry-pick reference, automatically add the 'Backported to WP Core' label to the original trunk PR. Detection strategies: - Explicit 'cherry-pick of/from #N' in PR title/body - GitHub PR URL references in cherry-pick context - Git's automatic '(cherry picked from commit SHA)' annotation - PR number patterns (#N) in merge commit messages
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Sahitya3105, @JiwaniZakir, @Kunal152000. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Sahitya3105! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
Could a maintainer please add the |
|
Hi! Just a gentle follow-up on this PR. All checks seem to be passing now—would appreciate a review when convenient. Thanks! |
What?
Closes #76579
Adds a new GitHub Actions workflow (
.github/workflows/label-manual-cherry-pick.yml) that automatically detects manual cherry-picks when a PR is merged to awp/*orrelease/*branch and labels the original trunk PR withBackported to WP Core.Why?
When the automatic cherry-pick workflow fails due to merge conflicts, contributors must manually
git cherry-pickand create a PR towp/*orrelease/*branches. However, they often forget to add theBackported to WP Corelabel to the original trunk PR, causing it to be missed in programmatically generated lists.How?
The workflow triggers on
pull_request_target→closed(merged) events targetingwp/**orrelease/**branches and uses four detection strategies to find the original PR number:cherry-pick of #12345cherry-picked from https://github.com/WordPress/gutenberg/pull/12345(cherry picked from commit <SHA>)from the merge commit to the original trunk PR via the GitHub API(#12345)patterns from squashed commit messagesAfter detection, it validates the original PR targets
trunk, skips already-labeled PRs for idempotency, and applies theBackported to WP Corelabel.Testing Instructions
This workflow only runs in
WordPress/gutenbergwhen a PR is merged towp/**orrelease/**branches. To verify:cherry-pick of #12345,cherry-picked from #12345).git.getCommit,repos.listPullRequestsAssociatedWithCommit,pulls.get,issues.addLabels).Testing Instructions for Keyboard
N/A — This is a CI workflow change with no UI modifications.
Screenshots or screencast
N/A — No UI changes.
Use of AI Tools
This PR was authored with the assistance of an AI coding assistant (Gemini) for code generation and review. All code has been reviewed and validated by the contributor.