Difference between revisions of "GitLab CI only:"

From wikieduonline
Jump to navigation Jump to search
(Created page with "https://docs.gitlab.com/ee/ci/yaml/#only--except * {{gitlab-ci.yml}}")
 
 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
  
 +
== Official example ==
 +
job1:
 +
  [[script:]] echo
 +
  [[only:]]
 +
    - main
 +
    - /^issue-.*$/
 +
    - merge_requests
 +
 +
job2:
 +
  script: echo
 +
  [[except:]]
 +
    - main
 +
    - /^stable-branch.*$/
 +
    - schedules
  
 +
Both are equivalent (official example):
 +
job1:
 +
  script: echo
 +
  only:
 +
    - branches
 +
 +
job2:
 +
  script: echo
 +
  only:
 +
    [[refs:]]
 +
      - branches
 +
 +
 +
 +
 +
[[except:]]
 +
 +
 +
== See also ==
 
* {{gitlab-ci.yml}}
 
* {{gitlab-ci.yml}}
 +
* {{GitLab CI}}
 +
 +
[[Category:GitLab]]

Latest revision as of 08:47, 28 September 2022

https://docs.gitlab.com/ee/ci/yaml/#only--except


Official example[edit]

job1:
  script: echo
  only:
    - main
    - /^issue-.*$/
    - merge_requests

job2:
  script: echo
  except:
    - main
    - /^stable-branch.*$/
    - schedules

Both are equivalent (official example):

job1:
 script: echo
 only:
   - branches

job2:
 script: echo
 only:
   refs:
     - branches



except:


See also[edit]

Advertising: