Copy
Copy a pull request to another branch.
The copy
action enables you to automatically create a copy of a 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.
Note that in case of a conflict during the copy, 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 copy
action takes a list of branches to which the changes from the pull
request will be copied. The branch names should be specified as strings.
Key name | Value type | Default | |
---|---|---|---|
assignees | list of template | ||
body | template |
| |
A string template using the Jinja2 syntax. | |||
bot_account | template or null |
| |
branches | list of Branch Name | ||
ignore_conflicts | boolean |
| |
label_conflicts | string |
| |
labels | list of string | ||
merge_conflict_style | merge or diff3 |
| |
regexes | list of | ||
report_mode | list of check or comment |
| |
title | template |
| |
A string template using the Jinja2 syntax. |
As the title and body are templates, you can leverage any pull request
attributes to use as content, e.g., {{author}}
.
Note that the commits
attribute here will be the list of cherry
picked commits.
On top of that, you can also use the following additional variables:
-
{{ 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 Copy
Section titled Using Labels to CopyBelow is an example of how to use the copy
action:
pull_request_rules:
- name: copy patches to the prod branch
conditions:
- label = copy-to-prod
actions:
copy:
branches:
- prod