Backport
Copy a pull request to another branch once it is merged.
The backport action enables you to automatically create a backport of a
merged pull request. When the conditions you specify are met, Mergify will
create a new pull request to merge the changes into the specified base branch.
The backport action is extremely useful for maintaining older versions of
your project. It helps automate the process of applying bug fixes or other
changes from the main branch to other branches.
Note that in case of a conflict during the backport, Mergify will create a pull
request with the conflict; you will have to resolve it manually. You can change
this behaviour using the ignore_conflicts option.
Parameters
Section titled ParametersThe backport action takes a list of branches to which the changes from the
merged pull request will be backported. The branch names should be specified as
strings.
| Key name | Value type | Default | |
|---|---|---|---|
assignees | list of template  | ||
Users to assign the newly created pull request. As the type is a data type template, you could use, e.g.,   | |||
body | template  | |-
  This is an automatic backport of pull request #{{number}} done by [Mergify](https://mergify.com).
  {{cherry_pick_error}}
 | |
The pull request body.  | |||
bot_account | template  | ||
Mergify can impersonate a GitHub user to backport a pull request. If no   | |||
branches | list of branch names  | []
 | |
The list of branches the pull request should be copied to.  | |||
ignore_conflicts | boolean | true
 | |
Whether to create the pull requests even if they are conflicts when cherry-picking the commits.  | |||
labels | list of string  | ||
The list of labels to add to the created pull requests.  | |||
label_conflicts | string | conflicts
 | |
The label to add to the created pull request if it has conflicts and   | |||
regexes | list of string  | ||
The list of regexes to find branches the pull request should be copied to.  | |||
title | template  | "{{ title }} (backport #{{ number }})"
 | |
The pull request title.  | |||
As the title and body are templates, you can leverage any pull request
attributes to use as content, e.g., {{author}}. You can also use this
additional variable:
- 
{{ destination_branch }}: the name of the destination branch. - 
{{ cherry_pick_error }}: the cherry pick error message if any (only available in body). 
Examples
Section titled ExamplesUsing Labels to Backport
Section titled Using Labels to BackportBelow is an example of how to use the backport action:
pull_request_rules:  - name: backport patches to the release branch and assign to original author    conditions:      - label=backport    actions:      backport:        branches:          - "release-1.0"          - "release-1.1"        assignees:          - "{{ author }}"Combining Automatic Merge
Section titled Combining Automatic MergeYou can also combine the backport action with other actions like merge.
This can be useful in scenarios where you want to automatically backport and
merge pull requests that fulfill certain conditions.
Here’s an example:
pull_request_rules:  - name: backport patches to the release branch    conditions:      - label=backport    actions:      backport:        branches:          - "release-1.0"          - "release-1.1"
  - name: automatically merge backport if they pass tests    conditions:      - author=mergify[bot]      - base~=^mergify/bp/      - head~=^release-1.      - check-success=continuous-integration    actions:      merge:        method: mergeIn this configuration, a pull request is backported when it has the label backport.
Then, when the backport is created and passes the check named
continuous-integration, it will be automatically merged.