To note: In the instance of a PR, the SEMAPHORE_GIT_PR_BRANCH variable has the expected branch name, whereas if code is being run against a branch directly (ie: main), SEMAPHORE_GIT_BRANCH is where it can be found.
Given how the findVar code works - SEMAPHORE_GIT_BRANCH will function as a fallback for SEMAPHORE_GIT_PR_BRANCH.
This adds support for Semaphore’s internal ENV vars used for specifying the current git branch and git sha.
To note: In the instance of a PR, the
SEMAPHORE_GIT_PR_BRANCH
variable has the expected branch name, whereas if code is being run against a branch directly (ie:main
),SEMAPHORE_GIT_BRANCH
is where it can be found.Given how the
findVar
code works -SEMAPHORE_GIT_BRANCH
will function as a fallback forSEMAPHORE_GIT_PR_BRANCH
.