0

I have tested when: manual and it works as expected. It creates a pipeline with a job that I can push play on.

But suppose I only want a job to have the manual option if a tag was created. Otherwise, skip this job.

This does not seem to work for me:

tag-triggered-manual-job:
  stage: publish
  only:
    variables:
      - $CI_COMMIT_TAG =~ /^product-build-.*/
  when: manual
  script:
    - script goes here
pnocti
  • 97
  • 8

1 Answers1

2

If you rewrite your job with rules it should work as excpected:

tag-triggered-manual-job:
  stage: publish
  script:
    - script goes here
  rules:
    - if: '$CI_COMMIT_TAG =~ /^product-build-.*/'
      when: manual
danielnelz
  • 3,794
  • 4
  • 25
  • 35
  • Thank you @danielnelz, I just got this a while ago. Also needed to add `allow_failure: true` so the pipeline is not marked as blocked. – pnocti Apr 28 '22 at 11:01