copy๐
The copy
action creates a copy of the pull request targeting other branches.
Options๐
Key Name |
Value Type |
Default |
Value Description |
---|---|---|---|
|
list of Template |
Users to assign the newly created pull request. As the type is
Template, you could use, e.g., |
|
|
|
The pull request body. |
|
|
Mergify can impersonate a GitHub user to copy a pull request.
If no bot_account is set, Mergify copies the pull request
itself. |
||
|
list of string |
|
The list of branches the pull request should be copied to. |
|
Boolean |
|
Whether to create the pull requests even if they are conflicts when cherry-picking the commits. |
|
list of string |
|
The list of labels to add to the created pull requests. |
|
string |
|
The label to add to the created pull request if it has conflicts and
|
|
list of string |
|
The list of regexes to find branches the pull request should be copied to. |
|
|
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 destination branch.
{{ cherry_pick_error }}
: the cherry pick error message if any (only available inbody
).
Examples๐
๐ Copy a Pull Request to Another Branch๐
The following rule copies a pull request from the staging
branch to the
prod
branch as soon as the CI passes and a label ready for prod
is set
on the pull request:
pull_request_rules:
- name: copy pull request when CI passes
conditions:
- base=staging
- check-success=test
- label=ready for prod
actions:
copy:
branches:
- prod