Meaning of CI_JOB_MANUAL

800 views
Skip to first unread message

Michael Remiš

unread,
Jun 14, 2017, 9:24:56 AM6/14/17
to GitLab
Hi there,

I was trying to use CI_JOB_MANUAL variable in my gitlab CI configuration, but its meaning is little bit confusing.

CI_JOB_MANUAL8.12allThe flag to indicate that job was manually started

But if I put someting like "echo $CI_JOB_MANUAL" in my script section in .gitlab-ci.yml:
1) when job is configured as "when: manual" it is always printed true
2) when job is NOT configured as "when: manual" it is always printed false (resp. nothing) even if I run job manually using GitLab UI


In my opinion, "The flag to indicate that job was manually started" means actual value independent of what is configured in "when" section.

In addition current meaning is useless as I always know what value I actually have in "when" section...


Any idea how to detect how job was actually triggered?

Thanks for discussion.

Ramon Fincken

unread,
Nov 24, 2017, 5:38:48 AM11/24/17
to GitLab
As per source code in build.rb:


    def action?
      self.when == 'manual'
    end

variables << { key: "CI_JOB_MANUAL", value: 'true', public: true } if action?

so only when when equals manual the CI_JOB_MANUAL is set to true it seam
Reply all
Reply to author
Forward
0 new messages