Skip to content

Commit 01e4f3a

Browse files
committed
Remove action name from build summary
1 parent 4d27314 commit 01e4f3a

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/buildSummary.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import * as core from "@actions/core";
33
import { join } from "path";
44
import { readFileSync, unlinkSync, existsSync } from "fs";
55

6-
export function addSummary(taskSummaryTableRows: string[][], actionName: string) {
6+
export function addSummary(taskSummaryTableRows: string[][]) {
77
try {
8-
core.summary
9-
.addHeading("MATLAB Build Results (" + actionName + ") ")
10-
.addTable(taskSummaryTableRows);
8+
core.summary.addHeading("MATLAB Build Results").addTable(taskSummaryTableRows);
119
} catch (e) {
1210
console.error("An error occurred while adding the build results table to the summary:", e);
1311
}
@@ -45,7 +43,7 @@ export function interpretSkipReason(skipReason: string) {
4543
}
4644
}
4745

48-
export function processAndAddBuildSummary(runnerTemp: string, runId: string, actionName: string) {
46+
export function processAndAddBuildSummary(runnerTemp: string, runId: string) {
4947
const header = [
5048
{ data: "MATLAB Task", header: true },
5149
{ data: "Status", header: true },
@@ -73,6 +71,6 @@ export function processAndAddBuildSummary(runnerTemp: string, runId: string, act
7371
);
7472
}
7573
}
76-
addSummary(taskSummaryTable, actionName);
74+
addSummary(taskSummaryTable);
7775
}
7876
}

src/buildSummary.unit.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,12 @@ describe("summaryGeneration", () => {
7878
["MATLAB Task", "Status", "Description", "Duration (HH:mm:ss)"],
7979
["Test Task", "🔴 Failed", "A test task", "00:00:10"],
8080
];
81-
const actionName = "run-build";
82-
83-
buildSummary.addSummary(mockTableRows, actionName);
81+
buildSummary.addSummary(mockTableRows);
8482

8583
expect(core.summary.addHeading).toHaveBeenCalledTimes(1);
8684
expect(core.summary.addHeading).toHaveBeenNthCalledWith(
8785
1,
88-
expect.stringContaining("MATLAB Build Results (" + actionName + ")"),
86+
expect.stringContaining("MATLAB Build Results"),
8987
);
9088
expect(core.summary.addTable).toHaveBeenCalledTimes(1);
9189
expect(core.summary.addTable).toHaveBeenCalledWith(mockTableRows);

0 commit comments

Comments
 (0)