Running a Cit GitLab job only if the trigger creates a tag

I want to run a conditional assembly called by an api trigger, but only when the ref passed by the trigger matches a specific regular expression.

I can imagine two ways to do this:

Logical operators in the .gitlab-ci.yml directive only::

only:
   - /^staging-v.*$/ AND triggers

or

Managing result status using return codes

script:
   - return 3;

will be interpreted as “not running” or “skipped”

Am I missing something? I read all the documentation I could find, but this scenario is never explained. Is it possible that this can be done?

That would be convenient with the new environmentsGitLab 8.9 feature . I am using the latest release of 8.9.0 gitlab.

API, .

+4

All Articles