Skip to content

Commit 07074e7

Browse files
authored
Update build-pr.yml
1 parent 39c6cba commit 07074e7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

.github/workflows/build-pr.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,12 @@ jobs:
5454
- name: Build
5555
run: pnpm run build
5656

57-
- name: Get Project Version from Git Tag
57+
- name: Get Commit SHA (short)
5858
id: get_version
5959
run: |
60-
# Use 'git describe' to find the closest tag, falling back to the commit SHA if no tag is found.
61-
# --tags includes all tags, --always ensures it always outputs something.
62-
VERSION=$(git describe --tags --always)
63-
echo "Project version is $VERSION"
60+
# Get the short 8-character commit SHA
61+
VERSION=$(git rev-parse --short=8 HEAD)
62+
echo "Commit SHA is $VERSION"
6463
echo "tag=$VERSION" >> $GITHUB_OUTPUT
6564
6665
- name: SonarQube Analysis (Pull Request)

0 commit comments

Comments
 (0)