{"id":50539159,"url":"https://github.com/creydr/cherry-pick-action","last_synced_at":"2026-06-03T19:01:09.320Z","repository":{"id":354413898,"uuid":"1223452810","full_name":"creydr/cherry-pick-action","owner":"creydr","description":"GitHub action to cherry-pick your PRs into other branches","archived":false,"fork":false,"pushed_at":"2026-05-26T10:00:50.000Z","size":400,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T11:33:19.508Z","etag":null,"topics":["actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creydr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T10:39:11.000Z","updated_at":"2026-05-26T09:58:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/creydr/cherry-pick-action","commit_stats":null,"previous_names":["creydr/cherry-pick-action"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/creydr/cherry-pick-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creydr%2Fcherry-pick-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creydr%2Fcherry-pick-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creydr%2Fcherry-pick-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creydr%2Fcherry-pick-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creydr","download_url":"https://codeload.github.com/creydr/cherry-pick-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creydr%2Fcherry-pick-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33876333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions"],"created_at":"2026-06-03T19:01:08.332Z","updated_at":"2026-06-03T19:01:09.297Z","avatar_url":"https://github.com/creydr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cherry-Pick Action\n\n[![CI](https://github.com/creydr/cherry-pick-action/actions/workflows/ci.yml/badge.svg)](https://github.com/creydr/cherry-pick-action/actions/workflows/ci.yml)\n[![Release](https://img.shields.io/github/v/release/creydr/cherry-pick-action)](https://github.com/creydr/cherry-pick-action/releases/latest)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nCherry-pick pull requests to other branches by commenting `/cherry-pick \u003ctarget-branch\u003e`.\n\n## Usage\n\nAdd the following workflow to your repository (e.g. `.github/workflows/cherry-pick.yml`):\n\n```yaml\nname: Cherry-pick\non:\n  pull_request_target:\n    types: [closed]\n  issue_comment:\n    types: [created]\n\npermissions:\n  contents: write\n  pull-requests: write\n\njobs:\n  cherry-pick:\n    name: Cherry-pick\n    runs-on: ubuntu-latest\n    if: \u003e\n      (\n        github.event_name == 'pull_request_target' \u0026\u0026\n        github.event.pull_request.merged\n      ) || (\n        github.event_name == 'issue_comment' \u0026\u0026\n        github.event.issue.pull_request \u0026\u0026\n        contains(github.event.comment.body, '/cherry-pick')\n      )\n    steps:\n      - uses: actions/checkout@v4\n      - name: Cherry-pick pull request\n        uses: creydr/cherry-pick-action@v1\n```\n\nThen, on any merged pull request, add a comment:\n\n```\n/cherry-pick release-1.0\n```\n\nThe action will cherry-pick the PR's commits into a new branch and open a pull request targeting `release-1.0`.\n\n### Multiple branches\n\nSpecify multiple target branches in a single command:\n\n```\n/cherry-pick release-1.0 release-1.1\n```\n\nOr use multiple commands in one comment:\n\n```\n/cherry-pick release-1.0\n/cherry-pick release-2.0\n```\n\n### Trigger behavior\n\n- **`issue_comment` (created):** When a `/cherry-pick` comment is posted on a merged PR, the action processes that comment immediately.\n- **`pull_request_target` (closed/merged):** When a PR is merged, the action scans all existing comments for `/cherry-pick` commands and processes each unique target.\n\n## Inputs\n\n| Input | Description | Default |\n| --- | --- | --- |\n| `github_token` | Token to authenticate requests to GitHub. Either `GITHUB_TOKEN` or a repo-scoped Personal Access Token (PAT). | `${{ github.token }}` |\n| `github_workspace` | Working directory for the action. | `${{ github.workspace }}` |\n| `comment_pattern` | Regex pattern to match cherry-pick commands. Must contain a capture group for the target branch(es). The captured group is split by whitespace. | `^\\/cherry-pick (.+)$` |\n| `cherry_picking` | Determines which commits are cherry-picked. `auto` detects the merge method (squash, rebase, merge commit). `pull_request_head` always uses the PR's commits. | `auto` |\n| `merge_commits` | How to handle merge commits. `fail` aborts on merge commits. `skip` ignores them. | `fail` |\n\n### Pull request options\n\n| Input | Description | Default |\n| --- | --- | --- |\n| `pull_title` | Template for the cherry-pick PR title. | `[${target_branch}] ${pull_title}` |\n| `pull_description` | Template for the cherry-pick PR body. | `# Description\\nCherry-pick of #${pull_number} to \\`${target_branch}\\`.` |\n| `branch_name` | Template for the cherry-pick branch name. | `cherry-pick-${pull_number}-to-${target_branch}` |\n\n#### Template placeholders\n\nThe following placeholders can be used in `pull_title`, `pull_description`, and `branch_name`:\n\n| Placeholder | Description |\n| --- | --- |\n| `${pull_number}` | Number of the original pull request |\n| `${pull_title}` | Title of the original pull request |\n| `${pull_author}` | Login of the original pull request author |\n| `${pull_description}` | Body of the original pull request |\n| `${target_branch}` | Target branch for the cherry-pick |\n| `${issue_refs}` | Space-separated issue references mentioned in the original PR body |\n\n### Labels\n\n| Input | Description | Default |\n| --- | --- | --- |\n| `add_labels` | Comma-separated labels to add to the cherry-pick PR. | _(none)_ |\n| `copy_labels_pattern` | Regex pattern to match labels to copy from the original PR. | _(none)_ |\n\n### Assignees\n\n| Input | Description | Default |\n| --- | --- | --- |\n| `copy_assignees` | Copy assignees from the original PR. | `false` |\n| `add_author_as_assignee` | Set the original PR author as an assignee. | `false` |\n\n### Reviewers\n\n| Input | Description | Default |\n| --- | --- | --- |\n| `copy_requested_reviewers` | Copy requested reviewers from the original PR. | `false` |\n| `copy_all_reviewers` | Copy all reviewers (requested + submitted) from the original PR. | `false` |\n| `add_author_as_reviewer` | Request a review from the original PR author. | `false` |\n| `add_reviewers` | Comma-separated list of reviewers to add. | _(none)_ |\n| `add_team_reviewers` | Comma-separated list of team reviewers to add. | _(none)_ |\n\n### Milestone\n\n| Input | Description | Default |\n| --- | --- | --- |\n| `copy_milestone` | Copy the milestone from the original PR. | `false` |\n\n### Auto-merge\n\n| Input | Description | Default |\n| --- | --- | --- |\n| `auto_merge_enabled` | Enable auto-merge on the cherry-pick PR. | `false` |\n| `auto_merge_method` | Merge method for auto-merge: `merge`, `squash`, or `rebase`. | `merge` |\n\n### Git committer\n\n| Input | Description | Default |\n| --- | --- | --- |\n| `git_committer_name` | Name of the committer for cherry-picked commits. | `github-actions[bot]` |\n| `git_committer_email` | Email of the committer for cherry-picked commits. | `github-actions[bot]@users.noreply.github.com` |\n\n### Advanced\n\n| Input | Description | Default |\n| --- | --- | --- |\n| `source_pr_number` | Explicitly specify the PR number to cherry-pick. When not set, the action determines it from the event payload. | _(none)_ |\n| `experimental` | JSON object for experimental features. See [Conflict resolution](#conflict-resolution). | `{\"conflict_resolution\": \"fail\"}` |\n\n## Outputs\n\n| Output | Description |\n| --- | --- |\n| `was_successful` | `true` if all cherry-picks succeeded, `false` otherwise. |\n| `was_successful_by_target` | Per-target results in the format `target=true\\|false`, one per line. |\n| `created_pull_numbers` | Space-separated list of created PR numbers. |\n\n## Triggering CI on cherry-pick PRs\n\nBy default, pull requests created by `GITHUB_TOKEN` do not trigger further workflow runs. This means CI checks won't run automatically on cherry-pick PRs. There are two ways to solve this:\n\n### Option 1: Use a GitHub App token\n\nCreate a [GitHub App](https://docs.github.com/en/apps/creating-github-apps) and use [actions/create-github-app-token](https://github.com/actions/create-github-app-token) to generate a token. This is the recommended approach for organizations since the token is scoped, short-lived, and not tied to a personal account:\n\n```yaml\npermissions:\n  contents: write\n  pull-requests: write\n\n...\n\nsteps:\n  - uses: actions/create-github-app-token@v2\n    id: app-token\n    with:\n      app-id: ${{ vars.APP_ID }}\n      private-key: ${{ secrets.APP_PRIVATE_KEY }}\n  - uses: actions/checkout@v4\n  - name: Cherry-pick pull request\n    uses: creydr/cherry-pick-action@v1\n    with:\n      github_token: ${{ steps.app-token.outputs.token }}\n```\n\nThe GitHub App needs **Contents** (read/write) and **Pull requests** (read/write) permissions.\n\n### Option 2: Use a Personal Access Token (PAT)\n\nPass a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) as `github_token`. PRs created with a PAT trigger CI normally:\n\n```yaml\npermissions:\n  contents: write\n  pull-requests: write\n\n...\n\nsteps:\n  - uses: actions/checkout@v4\n  - name: Cherry-pick pull request\n    uses: creydr/cherry-pick-action@v1\n    with:\n      github_token: ${{ secrets.PAT }}\n```\n\nThe PAT needs **Contents** (read/write) and **Pull requests** (read/write) permissions on the repository.\n\n## Conflict resolution\n\nBy default, the action fails when a cherry-pick encounters a conflict. To instead create a draft PR with the conflict committed, set:\n\n```yaml\n- uses: creydr/cherry-pick-action@v1\n  with:\n    experimental: '{\"conflict_resolution\": \"draft_commit_conflicts\"}'\n```\n\nWhen a conflict is committed, the action posts instructions on how to resolve it locally:\n\n```bash\ngit fetch origin \u003cbranch\u003e\ngit worktree add --checkout .worktree/\u003cbranch\u003e \u003cbranch\u003e\ncd .worktree/\u003cbranch\u003e\ngit reset --hard HEAD^\ngit cherry-pick -x \u003ccommits\u003e\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nThis project was inspired and is based on [backport-action](https://github.com/korthout/backport-action).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreydr%2Fcherry-pick-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreydr%2Fcherry-pick-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreydr%2Fcherry-pick-action/lists"}