File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,16 @@ function _publishToLocalRegistry {
115115 echo " Publish To Local Registry"
116116 loadCacheFromBuildJob
117117 if [ -z " $BRANCH_NAME " ]; then
118- export BRANCH_NAME=" $( git symbolic-ref HEAD --short 2> /dev/null) "
119- if [ " $BRANCH_NAME " = " " ] ; then
120- BRANCH_NAME=" $( git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed ' s/remotes\/origin\///g' ) " ;
118+ if [ -z " $CODEBUILD_WEBHOOK_TRIGGER " ]; then
119+ export BRANCH_NAME=" $( git symbolic-ref HEAD --short 2> /dev/null) "
120+ if [ " $BRANCH_NAME " = " " ] ; then
121+ BRANCH_NAME=" $( git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed ' s/remotes\/origin\///g' ) " ;
122+ fi
123+ elif [[ " $CODEBUILD_WEBHOOK_TRIGGER " == " pr/" * ]]; then
124+ export BRANCH_NAME=${CODEBUILD_WEBHOOK_BASE_REF##*/ }
121125 fi
122126 fi
127+ echo $BRANCH_NAME
123128 git checkout $BRANCH_NAME
124129
125130 # Fetching git tags from upstream
You can’t perform that action at this time.
0 commit comments