fix(formatters): dedupe push count line, link workflow run name to actions

This commit is contained in:
RhenCloud committed 2026-08-13 19:37:20 +08:00
1 parent dfb65ef70d
commit cf65111e4e
5 files changed
+16 -18

No files matched your search

+1 -8
View File
@@ -58,14 +58,6 @@ export function formatPush(
descriptionParts.push(em("🆕") + t("events.push.branch_created"));
}
descriptionParts.push(
t("events.push.commits_pushed", {
count,
s: count !== 1 ? "s" : "",
ref: isTagPush ? tagLink(baseUrl, rawRef, ref) : branchLink(baseUrl, rawRef, ref),
}),
);
if (compareUrl) {
descriptionParts.push(t("events.push.view_comparison", { url: compareUrl }));
}
@@ -119,6 +111,7 @@ export function formatPush(
count,
s: count !== 1 ? "s" : "",
repo: repo ?? t("common.repository"),
ref: isTagPush ? tagLink(baseUrl, rawRef, ref) : branchLink(baseUrl, rawRef, ref),
}),
url: compareUrl,
color: GITHUB_COLORS.push,
+5 -2
View File
@@ -175,13 +175,16 @@ export function formatWorkflowRun(
});
}
const runLabel = workflow.html_url
? `[${workflow.name ?? "Workflow"} — ${status}](${workflow.html_url})`
: `${workflow.name ?? "Workflow"} — ${status}`;
return buildMessage(
{
author,
title: t("events.workflow_run.title", {
repo: repo ?? t("common.repository"),
name: workflow.name ?? "Workflow",
conclusion: status,
run: runLabel,
}),
url: workflow.html_url,
color: GITHUB_COLORS[colorKey],