Skip to content

Commit

Permalink
show calculated versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectHSI committed Nov 5, 2023
1 parent b84fc17 commit f06d42f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions determineReleaseVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@

usingNonMainBranch=false

ls /usr/bin/

commitHash=$(/usr/bin/git rev-parse --short HEAD)
branchName=$(/usr/bin/git rev-parse --abbrev-ref HEAD)

echo "Calculated Version (Commit Hash): '$($commitHash)'."
echo "Calculated Version (Branch Name): '$($branchName)'."

version=""

if [[ $branchName == "main" ]]; then
usingNonMainBranch=false
echo "Not on Main branch."
usingNonMainBranch=true
fi

version="$($commitHash)"

echo "Calculated Version (Stage 1): '$($commitHash)'."

if [[ $usingNonMainBranch = true ]]; then
version="$($version)-$($branchName)"
version="$($version)-$($branchName)"
fi

echo "Calculated Version: '$($version)'."
echo "Calculated Version (Final): '$($version)'."

echo "VersionID=$($version)" >> "$GITHUB_OUTPUT"

0 comments on commit f06d42f

Please sign in to comment.