Skip to content

Commit 39c6cba

Browse files
authored
Change version retrieval to short commit SHA
Updated the workflow to retrieve the short commit SHA instead of the project version from Git tags.
1 parent b8c7200 commit 39c6cba

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ jobs:
5151
- name: Build
5252
run: pnpm run build
5353

54-
- name: Get Project Version from Git Tag
54+
- name: Get Commit SHA (short)
5555
id: get_version
5656
run: |
57-
# Use 'git describe' to find the closest tag, falling back to the commit SHA if no tag is found.
58-
# --tags includes all tags, --always ensures it always outputs something.
59-
VERSION=$(git describe --tags --always)
60-
echo "Project version is $VERSION"
57+
# Get the short 8-character commit SHA
58+
VERSION=$(git rev-parse --short=8 HEAD)
59+
echo "Commit SHA is $VERSION"
6160
echo "tag=$VERSION" >> $GITHUB_OUTPUT
6261
6362
- name: SonarQube Analysis (Branch)

0 commit comments

Comments
 (0)