How to detect if build was triggered automatically or manually?

#1

I would like to run (or skip) given step if build was triggered manually or vice versa (if build was triggered due to defined trigger (e.g. push to branch)).

Is there any environment variable or flag to detect this?

0 Likes

#2

Hi @fehersanyi-bitrise, @bitce and sorry for direct call. Is it possible to detect if build was triggered manually?

0 Likes

#3

Hello @dominik.roszkowski

I just tested it now :sweat_smile:
if everything is true then
run-if: "{{ not .IsPR | and (getenv GIT_CLONE_COMMIT | eq “”)}}"
this will be true when the build is manual :thinking:

1 Like

#4

Could you guide me to the syntax of this expression? I don’t know how to revert it to trigger only when build is automatic/triggered.

0 Likes