feat(formatters): add updateKey for suite/deployment/comment edit-in-place

This commit is contained in:
RhenCloud 2026-08-15 18:18:52 +08:00
parent 3af50496a7
commit 2f8a87048e
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
4 changed files with 12 additions and 0 deletions

View file

@ -42,6 +42,7 @@ export function formatDeployment(
showEmoji: boolean,
): NeutralMessage {
const deployment = payload.deployment as {
id?: number;
environment?: string;
ref?: string;
sha?: string;
@ -88,6 +89,7 @@ export function formatDeployment(
}),
url: deployment.html_url ?? deployment.statuses_url,
color: GITHUB_COLORS.deployment_pending,
updateKey: repo && deployment.id != null ? `deployment:${repo}:${deployment.id}` : undefined,
fields,
},
t,
@ -109,6 +111,7 @@ export function formatDeploymentStatus(
description?: string;
};
const deployment = payload.deployment as {
id?: number;
sha?: string;
ref?: string;
environment?: string;
@ -163,6 +166,7 @@ export function formatDeploymentStatus(
author,
title: t("events.deployment.title", { repo: repo ?? t("common.repository"), env, state }),
color: GITHUB_COLORS[colorKey],
updateKey: repo && deployment.id != null ? `deployment:${repo}:${deployment.id}` : undefined,
fields,
},
t,