Skip to content

Commit

Permalink
fix: e2e webhook call on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
phani-srikar committed Jul 17, 2023
1 parent f5c1f13 commit 33b28f8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions shared-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,16 @@ function _publishToLocalRegistry {
echo "Publish To Local Registry"
loadCacheFromBuildJob
if [ -z "$BRANCH_NAME" ]; then
export BRANCH_NAME="$(git symbolic-ref HEAD --short 2>/dev/null)"
if [ "$BRANCH_NAME" = "" ] ; then
BRANCH_NAME="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g')";
if [ -z "$CODEBUILD_WEBHOOK_TRIGGER" ]; then
export BRANCH_NAME="$(git symbolic-ref HEAD --short 2>/dev/null)"
if [ "$BRANCH_NAME" = "" ] ; then
BRANCH_NAME="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g')";
fi
elif [[ "$CODEBUILD_WEBHOOK_TRIGGER" == "pr/"* ]]; then
export BRANCH_NAME=${CODEBUILD_WEBHOOK_BASE_REF##*/}
fi
fi
echo $BRANCH_NAME
git checkout $BRANCH_NAME

# Fetching git tags from upstream
Expand Down

0 comments on commit 33b28f8

Please sign in to comment.