Skip to content

Commit

Permalink
update variable handing
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed Mar 10, 2021
1 parent b6bdd56 commit 0b62817
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/github/github_get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ export CURRENT_VERSION=$(git describe --tag --always --long | sed -e 's/\(.*\)-\

#get current branch name
echo "GITHUB_EVENT_NAME:${GITHUB_EVENT_NAME}"
echo "GITHUB_REF:${GITHUB_REF}"
if [[ "$GITHUB_EVENT_NAME" != "pull_request" ]]; then
echo "GIT_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
echo "GITHUB_REF:${GITHUB_REF}"
export GIT_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr / -)
fi
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
echo "GIT_BRANCH=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
echo "GITHUB_HEAD_REF:${GITHUB_HEAD_REF}"
export GIT_BRANCH=$(echo ${GITHUB_HEAD_REF} | tr / -)
fi
echo ::set-output name=GIT_BRANCH::${GIT_BRANCH}
echo "GIT_BRANCH:${GIT_BRANCH}"
echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_ENV
echo ::set-output name=GIT_BRANCH::${GIT_BRANCH}



Expand Down

0 comments on commit 0b62817

Please sign in to comment.