-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Switch to pull_request_target for the cherry picking workflows #60231
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
Conversation
Testing GuidelinesHi @albarin @woocommerce/flux, Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
📝 WalkthroughWalkthroughThe triggers for three GitHub Actions workflows were updated from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/cherry-pick-milestoned-prs.yml
(1 hunks).github/workflows/cherry-pick-to-frozen.yml
(1 hunks).github/workflows/cherry-pick-to-trunk.yml
(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Provide clear, step-by-step instructions for how to test the changes in the PR description.
Learnt from: prettyboymp
PR: woocommerce/woocommerce#59048
File: .github/workflows/cherry-pick-milestoned-prs.yml:118-131
Timestamp: 2025-07-11T13:05:08.440Z
Learning: In GitHub Actions workflows, when reviewing steps that access event data like `github.event.pull_request.milestone`, check the entire job dependency chain and conditional logic. If upstream jobs already validate the data exists (like checking `github.event.pull_request.milestone != null` in a prerequisite job), then downstream jobs don't need redundant null-checks since the data is guaranteed to exist by that point.
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#59675
File: .github/workflows/release-bump-as-requirement.yml:48-65
Timestamp: 2025-07-15T15:39:21.856Z
Learning: In WooCommerce core repository, changelog entries for all PRs live in `plugins/woocommerce/changelog/` directory and are processed during releases, not at the repository root level.
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Applies to .github/PULL_REQUEST_TEMPLATE.md : Preserve required markdown sections in the PR description, especially those used by automation (e.g., changelog entry details and comments). Do not remove or alter them.
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Applies to .github/PULL_REQUEST_TEMPLATE.md : The changelog section in the PR description must keep the markdown structure from the PR template exactly as-is, including all checkboxes, comments, and headings. Only the appropriate checkbox may be checked, and the changelog message must be placed under the `#### Comment` heading and before the closing `</details>` tag. Do not add, remove, or reformat any part of the changelog section except for checking the box and adding the message in the correct place.
📚 Learning: in github actions workflows, when reviewing steps that access event data like `github.event.pull_req...
Learnt from: prettyboymp
PR: woocommerce/woocommerce#59048
File: .github/workflows/cherry-pick-milestoned-prs.yml:118-131
Timestamp: 2025-07-11T13:05:08.440Z
Learning: In GitHub Actions workflows, when reviewing steps that access event data like `github.event.pull_request.milestone`, check the entire job dependency chain and conditional logic. If upstream jobs already validate the data exists (like checking `github.event.pull_request.milestone != null` in a prerequisite job), then downstream jobs don't need redundant null-checks since the data is guaranteed to exist by that point.
Applied to files:
.github/workflows/cherry-pick-milestoned-prs.yml
.github/workflows/cherry-pick-to-trunk.yml
.github/workflows/cherry-pick-to-frozen.yml
📚 Learning: applies to .github/pull_request_template.md : preserve required markdown sections in the pr descript...
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Applies to .github/PULL_REQUEST_TEMPLATE.md : Preserve required markdown sections in the PR description, especially those used by automation (e.g., changelog entry details and comments). Do not remove or alter them.
Applied to files:
.github/workflows/cherry-pick-milestoned-prs.yml
📚 Learning: applies to .github/pull_request_template.md : the changelog section in the pr description must keep ...
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-07-21T05:22:46.426Z
Learning: Applies to .github/PULL_REQUEST_TEMPLATE.md : The changelog section in the PR description must keep the markdown structure from the PR template exactly as-is, including all checkboxes, comments, and headings. Only the appropriate checkbox may be checked, and the changelog message must be placed under the `#### Comment` heading and before the closing `</details>` tag. Do not add, remove, or reformat any part of the changelog section except for checking the box and adding the message in the correct place.
Applied to files:
.github/workflows/cherry-pick-milestoned-prs.yml
🔇 Additional comments (2)
.github/workflows/cherry-pick-milestoned-prs.yml (1)
7-9
: No further action needed – checkout is limited to the target branch
Theactions/checkout@v4
step in.github/workflows/shared-cherry-pick.yml
(lines 180–183) uses onlywith: ref: ${{ inputs.target_branch }}so it never fetches the PR’s HEAD. Untrusted code isn’t checked out with write-scope credentials.
.github/workflows/cherry-pick-to-frozen.yml (1)
7-8
: Consistency good – re-confirm safetyThe trigger change is consistent with the other cherry-pick workflows.
Please run the same audit onshared-cherry-pick.yml
to guarantee no unsafe checkout of the PR head occurs under elevated permissions.No further issues spotted.
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.
Changes look good, confirmed both scenarios work as described ✅
Changes proposed in this Pull Request:
This switches the cherry picking workflows to run on the
pull_request_target
event instead ofpull_request
. which modifies the workflow to use the permissions of the target branch instead of the merging branch.This fixes an issue where PRs that originated from a fork branch were run in the context of the fork and didn't have the proper permissions/secrets to execute the steps needed complete the cherry-pick or update the PR afterwards.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Setup
trunk
,release/10.1
, andrelease/10.0
.10.0.0
,10.1.0
,10.2.0
code freeze exception
,cherry pick to trunk
,cherry pick to frozen release
,point release request
CODE_FREEZE_BOT_TOKEN, get the token value from the Test Assistant bot from the secret store.
WOO_RELEASE_SLACK_CHANNEL: You can use the test channel test-woo-core-release-notifications.
WOO_RELEASE_SLACK_NOTIFICATION_CHANNEL: You can use the test channel test-woo-core-release-notifications.
fix/cherry-pick-permissions-for-forks
and merge it (to get these changes into trunk). Add the10.0
milestone to the PR to simplify getting these changes into the release branches.Testing backporting
woocommerce:testing-60231
already available.cherry-pick-milestoned-prs
workflow and make sure it cherry picks to therelease/10.1
branch properly and adds comments and labels to the PRs.Testing forwardporting
woocommerce:test-pr-60231-forwardporting
already available.release/10.0
.cherry pick to frozen release
andcherry pick to trunk
labels.cherry-pick-*
workflows and make sure it cherry picks to therelease/10.1
branch properly and adds comments and labels to the PRs.Testing that has already taken place:
I have gone through the above testing instructions and created the following PRs on my fork:
prettyboymp#194
prettyboymp#193
prettyboymp#190
Changelog entry
Workflow changes only.
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment