mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
feat: link commit in check suite messages
Add clickable commit links in check_suite formatter output with fallback URL when html_url is unavailable. Remove check_run from checks template since formatter only handles check_suite events.
This commit is contained in:
parent
5deff66b8d
commit
55eafaeecc
3 changed files with 14 additions and 4 deletions
|
|
@ -60,7 +60,10 @@ export function formatCheckSuite(
|
|||
if (suite.head_sha) {
|
||||
fields.push({
|
||||
name: t("fields.commit"),
|
||||
value: suite.head_sha.slice(0, 7),
|
||||
value:
|
||||
repo && suite.head_sha
|
||||
? `[${suite.head_sha.slice(0, 7)}](https://github.com/${repo}/commit/${suite.head_sha})`
|
||||
: `\`${suite.head_sha.slice(0, 7)}\``,
|
||||
inline: true,
|
||||
});
|
||||
}
|
||||
|
|
@ -72,7 +75,11 @@ export function formatCheckSuite(
|
|||
repo: repo ?? t("common.repository"),
|
||||
conclusion: status,
|
||||
}),
|
||||
url: suite.html_url,
|
||||
url:
|
||||
suite.html_url ??
|
||||
(repo && suite.head_sha
|
||||
? `https://github.com/${repo}/commit/${suite.head_sha}/checks`
|
||||
: undefined),
|
||||
color: GITHUB_COLORS[colorKey],
|
||||
fields,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue