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:
RhenCloud 2026-08-03 09:19:00 +08:00
parent 5deff66b8d
commit 55eafaeecc
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
3 changed files with 14 additions and 4 deletions

View file

@ -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,
},