Skip to content

Commit 6edcb81

Browse files
committed
Update Discord notifications: use numbered list with clickable commit hashes
1 parent cca3b33 commit 6edcb81

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/discord-activity.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ jobs:
1616
REF=$(jq -r '.ref' <<< "$EVENT" | sed 's|refs/heads/||')
1717
COMPARE=$(jq -r '.compare' <<< "$EVENT")
1818
19-
# List every commit (one line per commit)
20-
COMMITS=$(jq -r '.commits[]
21-
| " • " + (.message | gsub("\\r?\\n"; " "))
22-
+ " [`" + .id[0:7] + "`] by " + .author.name' <<< "$EVENT")
19+
# List every commit with numbered list and clickable commit hash
20+
REPO_URL="https://github.com/${{ github.repository }}"
21+
COMMITS=$(jq -r --arg repo "$REPO_URL" '.commits | to_entries[] |
22+
(1 + .key | tostring) + ". " +
23+
(.value.message | gsub("\\r?\\n"; " ")) +
24+
" [" + .value.id[0:7] + "](" + $repo + "/commit/" + .value.id + ") by " + .value.author.name' <<< "$EVENT")
2325
2426
{
2527
echo "COUNT=$COUNT"

0 commit comments

Comments
 (0)