# HG changeset patch
# User Balasankar 'Balu' C <balasankar@gitlab.com>
# Date 1723229896 0
#      Fri Aug 09 18:58:16 2024 +0000
# Node ID 4d3d3ac4ecf2f05afec7022a213c0918212a5983
# Parent  ad4c3307314a8efc2ef4f399740a53ab05ed8640
Run issue-bot in protected and nightly pipelines

Adds issue-bot to protected and nightly pipelines for visibility when
the jobs fail.

Related https://gitlab.com/gitlab-org/distribution/team-tasks/-/issues/980

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -190,7 +190,15 @@
   image: registry.gitlab.com/gitlab-org/distribution/issue-bot:latest
   script: /issue-bot
   rules:
-    - if: '$CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH'
+    # Not needed in non-protected (feature) branches
+    - if: '$CI_COMMIT_REF_PROTECTED != "true"'
+      when: never
+    # Not needed in omnibus-gitlab-mirror
+    - if: '$CI_PROJECT_PATH == $QA_PROJECT_PATH'
       when: never
-    - if: '$PIPELINE_TYPE == "PROTECTED_TEST_PIPELINE"'
-      when: on_failure
+    # The remaining scenarios are all important pipelines we want to be
+    # notified about
+    # 0. Tags
+    # 1. Master branch - includes scheduled pipelines also
+    # 2. Stable branches
+    - when: always