Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/create-cherry-pick-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ on:
- 'next'
- 'v*.x'
- 'master'
types: ['closed']
types: ['closed', 'labeled']

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Opus 5.5 observation

If someone adds needs cherry-pick and v9.x in one label-picker action after merge, GitHub sends one labeled event per label. Each payload has the full label list, so both events pass this gate and start two runs.

Only one cherry-pick PR opens, because the concurrency group in the shared workflow runs the open step one at a time. But both detect jobs post "Cherry-pick PRs will be created targeting branches: v9.x" on the PR. If one action adds three labels, the newest queued job also cancels the pending job, and a cancelled run shows in the Actions tab.

I did not test this. A possible fix is in mui-public: post the comment from the open job after gh pr create, and include the new PR URL. The second run then stops at the existing-PR check and posts nothing.


permissions: {}

jobs:
create_pr:
name: Create cherry-pick PR
if: >-
${{ github.event.pull_request.merged &&
contains(github.event.pull_request.labels.*.name, 'needs cherry-pick') && (
github.event.action == 'closed' ||
github.event.label.name == 'needs cherry-pick' ||
(startsWith(github.event.label.name, 'v') && endsWith(github.event.label.name, '.x'))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Opus 5.5 observation

Adding a v*.x label re-runs the cherry-pick for every target label on the PR, not only for the new label. detectTargetBranch.js reads all v*.x labels, and the open-PR check skips a branch only while its cherry-pick PR is still open.

Example: the PR has needs cherry-pick + v9.x. The v9.x cherry-pick PR gets a manual conflict fix and is merged. Later, someone adds v8.x. The new run cherry-picks onto v9.x again with -X theirs. The conflicting hunks resolve to the master version, so the result is not empty. A new v9.x PR opens and reverts the manual fix. If the v9.x cherry-pick PR was closed as unwanted, the run opens it again.

The shared workflow already has a single-branch mode. We can use it for version-label events:

    with:
      target_branch: ${{ github.event.action == 'labeled' && github.event.label.name != 'needs cherry-pick' && github.event.label.name || '' }}
      pr_number: ${{ github.event.action == 'labeled' && github.event.label.name != 'needs cherry-pick' && format('{0}', github.event.pull_request.number) || '' }}

The retry path (remove and re-add needs cherry-pick) still re-runs all branches. The PR body can say that a retry also runs again on branches that already succeeded.

) }}
uses: mui/mui-public/.github/workflows/prs_create-cherry-pick-pr.yml@c6471a4fe98cb2e52efe7397ff8362569f2ddada # master
permissions:
contents: write
Expand Down
Loading