Skip to content

Commit

Permalink
Set BK_BRANCH to be basename of BUILDKITE_BRANCH
Browse files Browse the repository at this point in the history
Use the basename of `BUILDKITE_BRANCH` to take account of merge queue
branch names such as
`gh-readonly-queue/master/pr-1302-7f6d0543067187068f04eefcb7c3edd3b0e7e3ab`.
  • Loading branch information
ianoxley committed Sep 3, 2024
1 parent 438e5db commit b954d16
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ setup() {
export APP=$(cat .buildkite/.application)
export REPO=$1/$APP

# Setup the proper docker tag to be used depending on GH tag and/or branch
export BK_BRANCH="${BUILDKITE_BRANCH:-$BUILDKITE_TAG}"
# Setup the proper docker tag to be used depending on GH tag and/or branch.
#
# Note that merge queues may use a branch name such as
# gh-readonly-queue/master/pr-1302-7f6d0543067187068f04eefcb7c3edd3b0e7e3ab
# so we can use the basename of such branches.
branch_name=$(basename $BUILDKITE_BRANCH)
export BK_BRANCH="${branch_name:-$BUILDKITE_TAG}"

# Setup CI branch and time used by various other tools. E.g. ssm pusher
export CI_STRING_TIME=$(date '+%Y-%m-%d %H:%M:%S')
Expand Down

0 comments on commit b954d16

Please sign in to comment.