diff --git a/doc/ci/merge_request_pipelines/index.md b/doc/ci/merge_request_pipelines/index.md index 15b0403bcc015566e2f3c7043da5eda5d19a8d0e..1399bd9ec91f94c50d66c962dab516c5dac2acbc 100644 --- a/doc/ci/merge_request_pipelines/index.md +++ b/doc/ci/merge_request_pipelines/index.md @@ -225,9 +225,9 @@ which helps you get your starting configuration correct. If you are seeing two pipelines when using `only/except`, please see the caveats related to using `only/except` above (or, consider moving to `rules`). -It is not possible to run a job for branch pipelines first, then only for merge request -pipelines after the merge request is created (skipping the duplicate branch pipeline). See -the [related issue](https://gitlab.com/gitlab-org/gitlab/-/issues/201845) for more details. +In [GitLab 13.7](https://gitlab.com/gitlab-org/gitlab/-/issues/201845) and later, +you can add `workflow:rules` to [switch from branch pipelines to merge request pipelines](../yaml/README.md#switch-between-branch-pipelines-and-merge-request-pipelines) +after a merge request is open on the branch. ### Two pipelines created when pushing an invalid CI configuration file diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 05ce2c4d53dca123ed2d3f664fe837e47d61cfb7..d8357d455a8df1ca47064c9ba849f82664e79089 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -1251,8 +1251,11 @@ causes duplicated pipelines. To avoid duplicate pipelines, you can: -- Use [`workflow`](#workflow) to specify which types of pipelines - can run. +- Use the `CI_OPEN_MERGE_REQUESTS` CI/CD variable in [`workflow:rules`](#workflow) to + [switch between branch and merge request pipelines](#switch-between-branch-pipelines-and-merge-request-pipelines) + without duplication. You can also use this variable in individual job rules. +- Use [`workflow`](#workflow) to specify that only branch pipelines or only merge request + pipelines should run. - Rewrite the rules to run the job only in very specific cases, and avoid a final `when:` rule: