Correctly set CI_COMMIT when Buildkite provides HEAD instead of a real commit

This commit is contained in:
Michael Vines 2022-01-03 17:39:15 -08:00
parent 25cb859ed0
commit 6895eb7ef6
1 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,9 @@ if [[ -n $CI ]]; then
elif [[ -n $BUILDKITE ]]; then
export CI_BRANCH=$BUILDKITE_BRANCH
export CI_BUILD_ID=$BUILDKITE_BUILD_ID
if [[ $BUILDKITE_COMMIT = HEAD ]]; then
BUILDKITE_COMMIT="$(git rev-parse HEAD)"
fi
export CI_COMMIT=$BUILDKITE_COMMIT
export CI_JOB_ID=$BUILDKITE_JOB_ID
# The standard BUILDKITE_PULL_REQUEST environment variable is always "false" due