From 5ece9f84d6535f64e6145390f68b3fe0b0012f64 Mon Sep 17 00:00:00 2001
From: Marcel Amirault <4155490-marcel.amirault@users.noreply.gitlab.com>
Date: Tue, 1 Jun 2021 03:30:35 +0000
Subject: [PATCH] Update notes regarding double pipelines

---
 doc/ci/merge_request_pipelines/index.md | 6 +++---
 doc/ci/yaml/README.md                   | 7 +++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/doc/ci/merge_request_pipelines/index.md b/doc/ci/merge_request_pipelines/index.md
index 15b0403bcc015..1399bd9ec91f9 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 05ce2c4d53dca..d8357d455a8df 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:
 
-- 
GitLab