GitLab rules:

From wikieduonline
Revision as of 12:59, 10 October 2023 by Welcome (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

https://docs.gitlab.com/ee/ci/yaml/#rules

myjob:
   rules:
       - if: $CI_MERGE_REQUEST_ID
         when: always
       - when: never
   script:
       - echo "Test"

Official example (https://docs.gitlab.com/ee/ci/yaml/#rules):

docker build:
  script: docker build -t my-image:$CI_COMMIT_REF_SLUG .
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      changes:
        - Dockerfile
      when: manual
      allow_failure: true


!= 
==

Related

See also

Advertising: