fix(check): key check_run in-place edits on check name + head_sha

Providers that emit a fresh check run id per phase (e.g. Cloudflare Pages)
no longer post a new message for each status change; same name + commit
SHA now edits the existing message. Falls back to the run id when name or
head_sha is absent. Docs updated in sync.
This commit is contained in:
RhenCloud 2026-08-31 01:17:13 +08:00
parent cc8bb4182f
commit fd6ccda411
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
9 changed files with 47 additions and 8 deletions

View file

@ -178,6 +178,7 @@ export function formatCheckRun(
const checkRun = payload.check_run as {
id?: number;
name?: string;
head_sha?: string;
conclusion?: string;
html_url?: string;
details_url?: string;
@ -225,7 +226,12 @@ export function formatCheckRun(
url: checkRun.html_url,
color: GITHUB_COLORS[colorKey],
fields,
updateKey: repo && checkRun.id != null ? `check_run:${repo}:${checkRun.id}` : undefined,
updateKey:
repo && checkRun.name && checkRun.head_sha
? `check_run:${repo}:${checkRun.name}:${checkRun.head_sha}`
: repo && checkRun.id != null
? `check_run:${repo}:${checkRun.id}`
: undefined,
},
t,
repo,