mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +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
3
.github/workflows/lint-format.yml
vendored
3
.github/workflows/lint-format.yml
vendored
|
|
@ -12,7 +12,8 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-and-fix:
|
lint-format:
|
||||||
|
name: Lint & Format Fix
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
|
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -497,6 +497,7 @@ function formatWorkflowRun(
|
||||||
created_at?: string;
|
created_at?: string;
|
||||||
updated_at?: string;
|
updated_at?: string;
|
||||||
elapsed_seconds?: number;
|
elapsed_seconds?: number;
|
||||||
|
jobs?: Array<{ name?: string; conclusion?: string }>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const conclusion = workflow.conclusion ?? "pending";
|
const conclusion = workflow.conclusion ?? "pending";
|
||||||
|
|
@ -516,6 +517,17 @@ function formatWorkflowRun(
|
||||||
inline: true,
|
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) {
|
if (workflow.head_branch) {
|
||||||
fields.push({
|
fields.push({
|
||||||
name: t("fields.branch"),
|
name: t("fields.branch"),
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ export const en = {
|
||||||
milestone: "Milestone",
|
milestone: "Milestone",
|
||||||
status: "Status",
|
status: "Status",
|
||||||
run: "Run",
|
run: "Run",
|
||||||
|
job: "Job",
|
||||||
duration: "Duration",
|
duration: "Duration",
|
||||||
type: "Type",
|
type: "Type",
|
||||||
name: "Name",
|
name: "Name",
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ export const zh = {
|
||||||
milestone: "里程碑",
|
milestone: "里程碑",
|
||||||
status: "状态",
|
status: "状态",
|
||||||
run: "运行",
|
run: "运行",
|
||||||
|
job: "作业",
|
||||||
duration: "耗时",
|
duration: "耗时",
|
||||||
type: "类型",
|
type: "类型",
|
||||||
name: "名称",
|
name: "名称",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue