diff --git a/src/content/docs/commands/copy.mdx b/src/content/docs/commands/copy.mdx index d1c3516744..2fd7996a91 100644 --- a/src/content/docs/commands/copy.mdx +++ b/src/content/docs/commands/copy.mdx @@ -3,6 +3,8 @@ title: Mergify Copy Command description: Copy a pull request to another branch. --- +import CopyLimitations from '../workflow/actions/_copy_limitations.mdx'; + The `copy` command is a convenient tool in Mergify's suite, allowing users to replicate changes from a pull request to another branch within the same repository. This is particularly useful for teams working with multiple @@ -51,6 +53,8 @@ The `copy` command is especially handy for: - ``: The destination branch within the same repository. + + ## Example Assume you have made changes in a pull request targeting the `feature-x` branch diff --git a/src/content/docs/workflow/actions/_copy_limitations.mdx b/src/content/docs/workflow/actions/_copy_limitations.mdx new file mode 100644 index 0000000000..468f10b59b --- /dev/null +++ b/src/content/docs/workflow/actions/_copy_limitations.mdx @@ -0,0 +1,14 @@ +## Limitations + +:::caution + Pull requests containing merge commits cannot be copied (except for + merges of the base branch). +::: + +Mergify cannot copy a pull request that contains a merge commit, such as +when you merge a teammate's branch into yours. Merges of the base branch into +your pull request (for example, `Merge branch 'main'`) are an exception and +don't block the copy. + +To avoid this, rebase your pull request or squash its commits so its history +stays linear. diff --git a/src/content/docs/workflow/actions/copy.mdx b/src/content/docs/workflow/actions/copy.mdx index 92fbd8433b..65be0360c5 100644 --- a/src/content/docs/workflow/actions/copy.mdx +++ b/src/content/docs/workflow/actions/copy.mdx @@ -4,6 +4,7 @@ description: Copy a pull request to another branch. --- import ActionOptionsTable from '../../../../components/Tables/ActionOptionsTable'; +import CopyLimitations from './_copy_limitations.mdx'; 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 @@ -46,6 +47,8 @@ On top of that, you can also use the following additional variables: - `{{ cherry_pick_error }}`: the cherry pick error message if any (only available in body). + + ## Examples ### Using Labels to Copy