ci: add cherry-pick to latest release workflow (#24051)

Adds a GitHub Actions workflow that cherry-picks merged PRs to the
latest release branch when the `cherry-pick` label is applied.

## How it works

1. Add the `cherry-pick` label to any PR targeting `main` (before or
after merge).
2. On merge (or on label if already merged), the workflow detects the
latest `release/*` branch.
3. It cherry-picks the merge commit (`-x -m1`) and opens a PR.

This complements the `backport` label (see #24025) which targets the
latest **3** release branches. `cherry-pick` targets only the **latest**
one — useful for getting fixes into the current release.

Created PRs follow existing repo conventions:
- **Branch:** `backport/<pr>-to-<version>`
- **Title:** `<original PR title> (#<pr>)` — e.g. `fix(site): correct
button alignment (#12345)`
- **Body:** links back to the original PR and merge commit

If the cherry-pick encounters conflicts, the workflow aborts the
cherry-pick, creates an empty commit with resolution instructions, and
opens the PR with a `[CONFLICT]` prefix so the author can resolve
manually.

Also:
- Removes `scripts/backport-pr.sh` (replaced by this workflow)
- Removes `.github/cherry-pick-bot.yml` (old bot config)
- Adds a section to the contributing docs explaining the `cherry-pick`
label

> [!NOTE]
> Generated with [Coder Agents](https://coder.com/agents)
This commit is contained in:
Garrett Delfosse
2026-04-08 10:22:33 -04:00
committed by GitHub
parent c5d720f73d
commit ab77154975
4 changed files with 152 additions and 138 deletions
+13
View File
@@ -291,6 +291,19 @@ specification, however, it's still possible to merge PRs on GitHub with a badly
formatted title. Take care when merging single-commit PRs as GitHub may prefer
to use the original commit title instead of the PR title.
### Cherry-picking to the latest release branch
When a merged PR on `main` should also ship in the current release,
add the **`cherry-pick`** label to the PR (before or after merge).
The automation detects the latest `release/*` branch, cherry-picks the
merge commit, and opens a PR for review. The PR reuses the original
title (e.g. `fix(site): correct button alignment (#12345)`) so the
change is meaningful in release notes.
If the cherry-pick encounters conflicts, the PR is still created with
instructions for manual resolution.
### Breaking changes
Breaking changes can be triggered in two ways: