Skip to content

Commit 6a0aff8

Browse files
committed
add opt-out input
1 parent 16e9f86 commit 6a0aff8

4 files changed

Lines changed: 21 additions & 11 deletions

File tree

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ inputs:
1313
Startup options for MATLAB
1414
required: false
1515
default: ""
16+
generate-job-summary:
17+
description: >-
18+
Whether to generate a job summary with test results and code coverage information
19+
required: false
20+
default: true
1621
runs:
1722
using: node24
1823
main: dist/index.js

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"dependencies": {
2323
"@actions/core": "^3.0.0",
2424
"@actions/exec": "^3.0.0",
25-
"common-utils": "github:matlab-actions/common-utils#v2.2.2"
25+
"common-utils": "github:matlab-actions/common-utils#kapilg/opt-out"
2626
},
2727
"devDependencies": {
2828
"@types/jest": "^30.0.0",

src/index.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ async function run() {
1414

1515
const command = core.getInput("command");
1616
const startupOpts = core.getInput("startup-options").split(" ");
17+
const generateJobSummary = core.getBooleanInput("generate-job-summary");
1718

1819
const helperScript = await matlab.generateScript(workspaceDir, command);
1920
const execOpts = {
2021
env: {
2122
...process.env,
2223
MW_BATCH_LICENSING_ONLINE: "true", // Remove when online batch licensing is the default
2324
MW_MATLAB_BUILDTOOL_DEFAULT_PLUGINS_FCN_OVERRIDE: "buildframework.getDefaultPlugins",
25+
MW_GENERATE_JOB_SUMMARY: String(generateJobSummary),
2426
},
2527
};
2628
await matlab
@@ -32,12 +34,15 @@ async function run() {
3234
startupOpts,
3335
)
3436
.finally(() => {
35-
const runnerTemp = process.env.RUNNER_TEMP || "";
36-
const runId = process.env.GITHUB_RUN_ID || "";
37+
if (generateJobSummary) {
38+
const runnerTemp = process.env.RUNNER_TEMP || "";
39+
const runId = process.env.GITHUB_RUN_ID || "";
40+
const actionName = process.env.GITHUB_ACTION || "";
3741

38-
buildSummary.processAndAddBuildSummary(runnerTemp, runId);
39-
testResultsSummary.processAndAddTestSummary(runnerTemp, runId, workspaceDir);
40-
core.summary.write();
42+
buildSummary.processAndAddBuildSummary(runnerTemp, actionName);
43+
testResultsSummary.processAndAddTestSummary(runnerTemp, runId, actionName, workspaceDir);
44+
core.summary.write();
45+
}
4146
});
4247
}
4348

0 commit comments

Comments
 (0)