Skip to content

Commit c22e3b9

Browse files
committed
chore(test): generate short sha
1 parent 51841ea commit c22e3b9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/create-release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@ jobs:
99
create_release:
1010
runs-on: ubuntu-latest
1111
permissions:
12-
contents: write
12+
contents: write # Grant permission to create releases/tags
1313
steps:
14+
# This new step manually calculates the short SHA
15+
- name: Get short SHA
16+
id: get_sha
17+
run: echo "sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
18+
19+
# This step now uses the output from the step above
1420
- name: Create Release
1521
uses: actions/create-release@v1
1622
env:
1723
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1824
with:
19-
tag_name: commit-${{ github.short_sha }}
20-
release_name: Release ${{ github.short_sha }}
25+
tag_name: commit-${{ steps.get_sha.outputs.sha }}
26+
release_name: Release ${{ steps.get_sha.outputs.sha }}
2127
body: |
2228
Automatic release created from commit ${{ github.sha }} on the main branch.
2329
draft: false

0 commit comments

Comments
 (0)