File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,17 @@ jobs:
68
68
with :
69
69
name : dist
70
70
71
- # Step 8: Publish release
71
+ # Step 8: Get short commit SHA (first 7 characters)
72
+ - name : Get short commit SHA
73
+ run : echo "COMMIT_HASH=$(echo ${GITHUB_SHA} | cut -c1-7)" >> $GITHUB_ENV
74
+
75
+ # Step 9: Publish release
72
76
- name : Publish release
73
77
uses : ncipollo/release-action@v1
74
78
with :
75
79
artifacts : ' dist/*'
76
80
token : ${{ secrets.GITHUB_TOKEN }} # Automatically available GitHub token
77
- tag : ${{ github.sha.slice(0, 7) }} # Use the first 7 characters of the commit hash as the tag
78
- name : Release ${{ github.event.head_commit.message }} # Optional: Customize release name
81
+ tag : ${{ env.COMMIT_HASH }} # Use the shortened commit hash
82
+ name : Release ${{ github.event.head_commit.message }} # Optional: Use commit message as the release name
79
83
draft : false
80
84
prerelease : false
You can’t perform that action at this time.
0 commit comments