Skip to content

Commit 548e0b2

Browse files
committed
Enhance GitHub workflow to include git tags in release metadata
1 parent 059087d commit 548e0b2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/build-native.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ jobs:
9090
COMMIT_SHA=$(git rev-parse HEAD)
9191
COMMIT_SHORT=$(git rev-parse --short HEAD)
9292
COMMIT_DATE=$(git log -1 --format=%cd --date=short)
93+
# Try to get the tag, if it exists
94+
TAG=$(git describe --tags --exact-match 2>/dev/null || echo "")
9395
echo "sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
9496
echo "short=$COMMIT_SHORT" >> $GITHUB_OUTPUT
9597
echo "date=$COMMIT_DATE" >> $GITHUB_OUTPUT
98+
echo "tag=$TAG" >> $GITHUB_OUTPUT
9699
97100
- name: Organize native libraries for release
98101
run: |
@@ -121,7 +124,7 @@ jobs:
121124
- name: Create GitHub Release
122125
uses: softprops/action-gh-release@v1
123126
with:
124-
name: ${{ github.ref_name }}
127+
name: ${{ steps.libssh2-info.outputs.tag || steps.libssh2-info.outputs.short }}
125128
body: |
126129
Built for libssh2@${{ steps.libssh2-info.outputs.short }} (committed on ${{ steps.libssh2-info.outputs.date }})
127130

0 commit comments

Comments
 (0)