Skip to content

Commit

Permalink
get branch and commit in gha
Browse files Browse the repository at this point in the history
  • Loading branch information
hillalex committed Aug 2, 2024
1 parent 50d2aad commit d6617d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/common
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
NAME=epikinetics-app
ORG=seroanalytics
PACKAGE_ROOT="${HERE}/.."
GIT_ID=$(git -C "$PACKAGE_ROOT" rev-parse --short=7 HEAD)
GIT_BRANCH=$(git -C "$PACKAGE_ROOT" symbolic-ref --short HEAD)

if [ -z "$GITHUB_REF" ]; then
GIT_BRANCH=$(git -C "$PACKAGE_ROOT" symbolic-ref --short HEAD)
GIT_ID=$(git -C "$PACKAGE_ROOT" rev-parse --short=7 HEAD)
else
GIT_BRANCH=$GITHUB_REF
GIT_ID=$(echo $GITHUB_SHA | cut -c1-7)
fi

DOCKER_COMMIT_TAG=$ORG/$NAME:$GIT_ID
DOCKER_BRANCH_TAG=$ORG/$NAME:$GIT_BRANCH

0 comments on commit d6617d7

Please sign in to comment.