How to detect if build was triggered automatically or manually?

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?

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

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

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.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.