Skip to content

Commit b5bfad1

Browse files
committed
feat(release workflow): Include commit hash links in changelog
1 parent 5ee95ef commit b5bfad1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,21 @@ jobs:
3333
zip -r "../../../${zip_name}" .
3434
echo "zip_name=${zip_name}" >> $GITHUB_OUTPUT
3535
36-
- name: Generate changelog
36+
- name: Generate changelog with commit links
3737
id: changelog
3838
run: |
39+
repo_url="https://github.com/${{ github.repository }}"
3940
git fetch --prune --unshallow
4041
previous_tag=$(git tag --sort=-creatordate | tail -n 1)
4142
if [ -z "$previous_tag" ]; then
42-
changelog=$(git log --pretty=format:"* %s")
43+
range=""
4344
else
44-
changelog=$(git log $previous_tag..HEAD --pretty=format:"* %s")
45+
range="$previous_tag..HEAD"
4546
fi
47+
changelog=""
48+
while read -r hash message; do
49+
changelog="${changelog}* [${message}](${repo_url}/commit/${hash})"$'\n'
50+
done < <(git log $range --pretty=format:"%H %s")
4651
echo "changelog<<EOF" >> $GITHUB_ENV
4752
echo "$changelog" >> $GITHUB_ENV
4853
echo "EOF" >> $GITHUB_ENV

0 commit comments

Comments
 (0)