Skip to content

Commit ac1f478

Browse files
authored
Update discord-notify.yml
1 parent c0316d5 commit ac1f478

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/discord-notify.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,27 @@ jobs:
4141
iso="$(date -u -d "$ts" +'%Y-%m-%dT%H:%M:%SZ')"
4242
4343
jq -n \
44-
--arg login "$login" \
44+
--arg login "$(jq -r --arg fb "$ACTOR_FALLBACK" '(.author.username // "") | if length==0 then $fb else . end' <<< "$c")" \
4545
--arg short "$short" \
4646
--arg url "$url" \
4747
--arg msg "$msg" \
48-
--arg foot "$repo_short - $BRANCH" \
49-
--arg iso "$iso" \
48+
--arg title "${repo_short} - ${BRANCH}" \
49+
--arg link "https://github.com/${REPO}/tree/${BRANCH}" \
50+
--arg iso "$(date -u -d "${ts:-$(date -Iseconds)}" +'%Y-%m-%dT%H:%M:%SZ')" \
5051
'{
5152
username: "GitHub",
5253
avatar_url: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
5354
embeds: [{
55+
title: $title,
56+
url: $link,
5457
color: 3113463,
5558
author: {
5659
name: $login,
5760
url: ("https://github.com/" + $login),
5861
icon_url: ("https://avatars.githubusercontent.com/" + $login)
5962
},
60-
description: ("[`" + $short + "`](" + $url + ")" + "\n" + $msg),
61-
footer: { text: $foot },
63+
description: ("[`" + $short + "`](" + $url + ")\n" + $msg + "\n\n\u200B"),
6264
timestamp: $iso
6365
}]
6466
}' \
6567
| curl -fsS -H 'Content-Type: application/json' -d @- "$WEBHOOK" >/dev/null
66-
done

0 commit comments

Comments
 (0)