mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-23 00:21:28 +00:00
feat: add job field to workflow run notification
This commit is contained in:
parent
2e4cb24c1d
commit
49baf63a17
4 changed files with 16 additions and 1 deletions
|
|
@ -497,6 +497,7 @@ function formatWorkflowRun(
|
|||
created_at?: string;
|
||||
updated_at?: string;
|
||||
elapsed_seconds?: number;
|
||||
jobs?: Array<{ name?: string; conclusion?: string }>;
|
||||
};
|
||||
|
||||
const conclusion = workflow.conclusion ?? "pending";
|
||||
|
|
@ -516,6 +517,17 @@ function formatWorkflowRun(
|
|||
inline: true,
|
||||
});
|
||||
|
||||
if (workflow.jobs?.length) {
|
||||
const jobLines = workflow.jobs.map(
|
||||
(j) => `${WORKFLOW_CONCLUSION_EMOJI[j.conclusion ?? ""] ?? "⏳"} ${j.name ?? ""}`,
|
||||
);
|
||||
fields.push({
|
||||
name: t("fields.job"),
|
||||
value: jobLines.join("\n"),
|
||||
inline: false,
|
||||
});
|
||||
}
|
||||
|
||||
if (workflow.head_branch) {
|
||||
fields.push({
|
||||
name: t("fields.branch"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue