Skip to content

Commit 538df7d

Browse files
committed
add opt-out field
1 parent 1f3ba3c commit 538df7d

4 files changed

Lines changed: 29 additions & 21 deletions

File tree

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ inputs:
8484
Startup options for MATLAB
8585
required: false
8686
default: ""
87+
opt-out-of-test-results-summary:
88+
description: >-
89+
Whether to opt out of the test results summary in the GitHub Action UI
90+
required: false
91+
default: false
8792
code-coverage-metric-level:
8893
description: >-
8994
Level of coverage metrics to collect

package-lock.json

Lines changed: 9 additions & 9 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.1.1"
25+
"common-utils": "github:matlab-actions/common-utils#kapilg/encoding-fix"
2626
},
2727
"devDependencies": {
2828
"@types/jest": "^30.0.0",

src/index.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ async function run() {
3131
LoggingLevel: core.getInput("logging-level"),
3232
};
3333

34+
const optOutOfTestResultsSummary = core.getBooleanInput("opt-out-of-test-results-summary");
3435
var codeCoverageMetricLevel = core.getInput("code-coverage-metric-level").toLowerCase();
3536

3637
// Validate metric level
@@ -65,18 +66,20 @@ async function run() {
6566
startupOptions,
6667
)
6768
.finally(() => {
68-
const runnerTemp = process.env.RUNNER_TEMP || "";
69-
const runId = process.env.GITHUB_RUN_ID || "";
70-
const actionName = process.env.GITHUB_ACTION || "";
69+
if(!optOutOfTestResultsSummary) {
70+
const runnerTemp = process.env.RUNNER_TEMP || "";
71+
const runId = process.env.GITHUB_RUN_ID || "";
72+
const actionName = process.env.GITHUB_ACTION || "";
7173

72-
//add test results and code coverage view
73-
testResultsSummary.processAndAddTestSummary(
74-
runnerTemp,
75-
runId,
76-
actionName,
77-
workspaceDir,
78-
);
79-
core.summary.write();
74+
//add test results and code coverage view
75+
testResultsSummary.processAndAddTestSummary(
76+
runnerTemp,
77+
runId,
78+
actionName,
79+
workspaceDir,
80+
);
81+
core.summary.write();
82+
}
8083
});
8184
}
8285

0 commit comments

Comments
 (0)