actions-marketplace-validations/Backport merged pull requests to selected branches

Fast and flexible action to cherry-pick commits from labeled pull requests

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Apr 27, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: actions-marketplace-validations/korthout_backport-action@2315a7cca1e8bae3e8344ac04b67093e4409ca66 # no releases — HEAD as of 2026-07-10

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
add_author_as_assigneeControls whether to set the author of the original pull request as an assignee on the backport pull request. By default, the original author is not made an assignee.
add_author_as_reviewerControls whether to request a review from the author of the original pull request on the backport pull request. By default, the original author is not requested for review. false
add_labelsThe action will add these labels (comma-delimited) to the backport pull request. By default, no labels are added.
add_reviewersThe action will add these reviewers (comma-delimited) to the backport pull request. By default, no reviewers are added. ""
add_team_reviewersThe action will add these teams as reviewers (comma-delimited) to the backport pull request. By default, no teams are added. ""
auto_merge_enabledControls whether to auto-merge the created backport pull request. When enabled, the pull request will automatically merge when all required checks pass and approvals are received. Can be set to a simple boolean (true/false) or controlled dynamically via workflow expressions. By default, auto-merge is not enabled. false
auto_merge_methodThe merge method to use when auto-merge is enabled on backport PRs. Valid options are 'merge' (create a merge commit), 'squash' (squash and merge), or 'rebase' (rebase and merge). The specified method must be enabled in your repository's merge settings, otherwise auto-merge will fail. By default, the backport PR is merged using a merge commit if auto-merge is enabled. merge
branch_nameTemplate used as the name for branches created by this action. Placeholders can be used to define variable values. These are indicated by a dollar sign and curly braces (`${placeholder}`). Please refer to this action's README for all available placeholders. backport-${pull_number}-to-${target_branch}
cherry_pickingDetermines which commits are cherry-picked. When set to `auto`, the action cherry-picks the commits based on the method used to merge the pull request. - For "Squash and merge", the action cherry-picks the squashed commit. - For "Rebase and merge", the action cherry-picks the rebased commits. - For "Merged as a merge commit", the action cherry-picks the commits from the pull request. When set to `pull_request_head`, the action cherry-picks the commits from the pull request. Specifically, those reachable from the pull request's head and not reachable from the pull request's base. By default, the action cherry-picks the commits based on the method used to merge the pull request. auto
comment_styleControls the style of comments posted by the action. When set to `legacy`, the action posts individual comments per target branch. When set to `summary`, the action posts a single summary comment per workflow run with actionable details. legacy
copy_all_reviewersControls whether to copy all reviewers from the original pull request to the backport pull request. Note that this requests reviews from both requested reviewers, and people that have already reviewed the original pull request. Use `copy_requested_reviewers` instead to only request reviews from requested reviewers. By default, all reviewers are not copied. false
copy_assigneesControls whether to copy the assignees from the original pull request to the backport pull request. By default, the assignees are not copied. false
copy_labels_patternRegex pattern to match github labels which will be copied from the original pull request to the backport pull request. Note that labels matching `label_pattern` are excluded. By default, no labels are copied.
copy_milestoneControls whether to copy the milestone from the original pull request to the backport pull request. By default, the milestone is not copied. false
copy_requested_reviewersControls whether to copy the requested reviewers from the original pull request to the backport pull request. Note that this does not request reviews from those users who already reviewed the original pull request. Use `copy_all_reviewers` instead to also request reviews from those users. By default, the requested reviewers are not copied. false
experimentalConfigure experimental features by passing a JSON object. The following properties can be specified: #### `conflict_resolution` Specifies how the action will handle a conflict occuring during the cherry-pick. In all cases, the action will stop the cherry-pick at the first conflict encountered. Behavior is defined by the option selected. - When set to `fail` the backport fails when the cherry-pick encounters a conflict. - When set to `draft_commit_conflicts` the backport will always create a draft pull request with the first conflict encountered committed. Instructions are provided on the original pull request on how to resolve the conflict and continue the cherry-pick. #### `downstream_repo` Define if you want to backport to a repository other than where the workflow runs. By default, the action always backports to the repository in which the workflow runs. #### `downstream_owner` Define if you want to backport to another owner than the owner of the repository the workflow runs on. Only takes effect if the `downstream_repo` property is also defined. By default, uses the owner of the repository in which the workflow runs. { "conflict_resolution": "fail" }
github_tokenToken to authenticate requests to GitHub. Used to create and label pull requests and to comment. Either GITHUB_TOKEN or a repo-scoped Personal Access Token (PAT). ${{ github.token }}
github_workspaceWorking directory for the backport action.${{ github.workspace }}
git_committer_nameName of the committer for the cherry-picked commit.github-actions[bot]
git_committer_emailEmail of the committer for the cherry-picked commit.github-actions[bot]@users.noreply.github.com
label_patternRegex pattern to match the backport labels on the merged pull request. Must contain a capture group for the target branch. The action will backport the pull request to each matched target branch. Note that the pull request's headref is excluded automatically. ^backport ([^ ]+)$
merge_commitsSpecifies how the action should deal with merge commits on the merged pull request. When set to `fail` the backport fails when the action detects one or more merge commits. When set to `skip` the action only cherry-picks non-merge commits, i.e. it ignores merge commits. fail
pull_descriptionTemplate used as description (i.e. body) in the pull requests created by this action. Placeholders can be used to define variable values. These are indicated by a dollar sign and curly braces (`${placeholder}`). Please refer to this action's README for all available placeholders. # Description Backport of #${pull_number} to `${target_branch}`.
pull_titleTemplate used as the title in the pull requests created by this action. Placeholders can be used to define variable values. These are indicated by a dollar sign and curly braces (`${placeholder}`). Please refer to this action's README for all available placeholders. [Backport ${target_branch}] ${pull_title}
source_pr_numberSpecifies the pull request (by its number) to backport, i.e. the source pull request. When set, the action will backport the specified pull request to each target branch. When not set, the action determines the source pull request from the event payload.
target_branchesThe action will backport the pull request to each specified target branch (space-delimited). Note that the pull request's headref is excluded automatically. Can be used in addition to backport labels. By default, only backport labels are used to specify the target branches.
namedescription
created_pull_numbersSpace-separated list containing the identifying number of each created pull request. Or empty when the action created no pull requests. For example, '123' or '123 124 125'.
was_successfulWhether or not the changes could be backported successfully to all targets. Either 'true' or 'false'.
was_successful_by_targetWhether or not the changes could be backported successfully to all targets - broken down by target. Follows the pattern '{{label}}=true|false'.