ci: fix discord integration (#1430)

This commit is contained in:
Juro Oravec 2025-10-03 14:31:12 +02:00 committed by GitHub
parent f781a6d7fe
commit 3e837e20c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 68 additions and 66 deletions

View file

@ -18,17 +18,18 @@ jobs:
--arg user "${{ github.event.discussion.user.login }}" \
--arg repo "${{ github.repository }}" \
--arg number "#${{ github.event.discussion.number }}" \
--arg timestamp "${{ github.event.discussion.created_at }}" \
'{
"username": "GitHub Discussions",
"avatar_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"embeds": [
{
"title": "New discussion: \($number) \($title)",
"url": \($url),
"title": ("New discussion: " + $number + " " + $title),
"url": $url,
"color": 16776960,
"author": {"name": \($user)},
"footer": {"text": \($repo)},
"timestamp": "${{ github.event.discussion.created_at }}"
"author": {"name": $user},
"footer": {"text": $repo},
"timestamp": $timestamp
}
]
}')

View file

@ -18,17 +18,18 @@ jobs:
--arg user "${{ github.event.issue.user.login }}" \
--arg repo "${{ github.repository }}" \
--arg number "#${{ github.event.issue.number }}" \
--arg timestamp "${{ github.event.issue.created_at }}" \
'{
"username": "GitHub Issues",
"avatar_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"embeds": [
{
"title": "New issue: \($number) \($title)",
"url": \($url),
"title": ("New issue: " + $number + " " + $title),
"url": $url,
"color": 3447003,
"author": {"name": \($user)},
"footer": {"text": \($repo)},
"timestamp": "${{ github.event.issue.created_at }}"
"author": {"name": $user},
"footer": {"text": $repo},
"timestamp": $timestamp
}
]
}')

View file

@ -18,19 +18,19 @@ jobs:
--arg user "${{ github.event.pull_request.user.login }}" \
--arg repo "${{ github.repository }}" \
--arg number "#${{ github.event.pull_request.number }}" \
--arg timestamp "${{ github.event.pull_request.created_at }}" \
'{
"username": "GitHub Pull Requests",
"avatar_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"embeds": [
{
"title": "New pull request: \($number) \($title)",
"url": \($url),
"title": ("New pull request: " + $number + " " + $title),
"url": $url,
"color": 3066993,
"author": {"name": \($user)},
"footer": {"text": \($repo)},
"timestamp": "${{ github.event.pull_request.created_at }}"
"author": {"name": $user},
"footer": {"text": $repo},
"timestamp": $timestamp
}
]
}')
curl -sS -X POST -H "Content-Type: application/json" -d "$payload" "$DISCORD_WEBHOOK_URL" | cat