Skip to content

Commit 40a6e22

Browse files
chore(actions): Improve release announcement
1 parent 79641fd commit 40a6e22

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/matrix-tag-notify.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,22 @@ jobs:
2222
PREV_TAG=$(git tag --sort=-version:refname | grep -v "^${TAG}$" | head -n1)
2323
2424
if [ -z "$PREV_TAG" ]; then
25-
COMMIT_LOG=$(git log "${TAG}" --pretty=format:"- %s (%h)" | head -50)
25+
LOG_RANGE="${TAG}"
2626
else
27-
COMMIT_LOG=$(git log "${PREV_TAG}..${TAG}" --pretty=format:"- %s (%h)" | head -50)
27+
LOG_RANGE="${PREV_TAG}..${TAG}"
2828
fi
2929
30+
REPO="${{ github.repository }}"
31+
COMMIT_LOG=""
32+
while IFS='|' read -r hash subject author; do
33+
if [[ "$subject" =~ \(#([0-9]+)\)[[:space:]]*$ ]]; then
34+
PR_NUM="${BASH_REMATCH[1]}"
35+
COMMIT_LOG+="- [$subject](https://github.com/${REPO}/pull/${PR_NUM}) by ${author}"$'\n'
36+
else
37+
COMMIT_LOG+="- [$subject](https://github.com/${REPO}/commit/${hash}) by ${author}"$'\n'
38+
fi
39+
done < <(git log "${LOG_RANGE}" --pretty=format:"%H|%s|%aN" | head -50)
40+
3041
# Escape for GitHub output (multiline)
3142
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
3243
echo "log<<${EOF}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)