gitlab-ci-local icon indicating copy to clipboard operation
gitlab-ci-local copied to clipboard

only keyword

Open naweiss opened this issue 2 years ago • 3 comments

In Gitlab CI you can add the keyword "only" for a job that should only be executed if specified condition is met: https://docs.gitlab.com/ee/ci/yaml/#only--except

For example to execute only on tagged commits:

build:
  script:
    - echo "building"
  only:
    - tags

gitlab-ci-local seems to completely ignore that setting. I don't get an error but the job runs regardless of whether changes take place or not.

naweiss avatar May 15 '22 11:05 naweiss

Gitlab relies on current commit for branch pipeline, and on new commits for MR pipeline.

But gitlab-ci-local does not rely on commits, for us to run the tool without having to commit each time.

How would you like that to work then ?

bcouetil avatar May 15 '22 14:05 bcouetil

The only instruction is not implemented yet... You have to use rules: until it is...

firecow avatar May 15 '22 15:05 firecow

Hello,

FYI, only/except are not actively developed, as of now even Gitlab recommends to use rules instead.

gitlab-ci-only

cs35-owncloud avatar May 30 '22 15:05 cs35-owncloud

I'm closing this, gitlab will deprecate this option soon

firecow avatar Dec 02 '22 17:12 firecow