Skip to content

Draft: Add CI variable CI_COMMIT_HAS_OTHER_PIPELINES

Furkan Ayhan requested to merge 15170-ci-commit-has-pipeline-variable into master

What does this MR do and why?

This MR adds a new CI variable CI_COMMIT_HAS_OTHER_PIPELINES, which is used for determining if there is another pipeline with the same sha. It returns either true as a string or nothing.

Related to #15170 (closed)

(previous attempt: !80164 (closed))

Screenshots or screen recordings

Example config:

workflow:
  rules:
    - if: $CI_COMMIT_HAS_OTHER_PIPELINES
      when: never
    - when: always

test:
  script: echo $CI_COMMIT_HAS_OTHER_PIPELINES

When I commit this change, I get a pipeline;

Screen_Shot_2022-03-03_at_21.35.55

However, I cannot create a new pipeline with the same commit sha:

Screen_Shot_2022-03-03_at_21.36.41

Or there is no new pipeline after I create a new branch;

Screen_Shot_2022-03-03_at_21.37.29

Screen_Shot_2022-03-03_at_21.37.42

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #15170 (closed)

Edited by Furkan Ayhan

Merge request reports