From 0fd3da49b6e2699fcd60e3988fa606bcc21faaf0 Mon Sep 17 00:00:00 2001 From: Jade Ellis Date: Thu, 25 Jul 2024 23:42:05 +0100 Subject: [PATCH] Allow disabling generation of HTML reports --- action.yml | 4 ++++ src/main.js | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 7d11c265..04fd3271 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,10 @@ inputs: required: true artifact-name: description: 'The GitHub artifact name of the generated HTML report. For example, `code-coverage-report`. _Note:_ When downloading, it will be extracted in an `html` directory. Optional. Default: `` (Skips uploading of artifacts)' + generate-html-report: + description: 'Set to `false` to skip generating the HTML report entirely. Optional. Default: `true`' + required: false + default: "true" minimum-coverage: description: 'The minimum coverage to pass the check. Optional. Default: `0` (always passes)' default: 0 diff --git a/src/main.js b/src/main.js index 347e3fe9..1f880559 100644 --- a/src/main.js +++ b/src/main.js @@ -19,7 +19,10 @@ async function run() { const additionalMessage = core.getInput('additional-message'); const updateComment = core.getInput('update-comment') === 'true'; - await genhtml(coverageFiles, tmpPath); + const genHtmlReport = core.getInput('generate-html-report') === 'true'; + if (genHtmlReport) { + await genhtml(coverageFiles, tmpPath); + } const coverageFile = await mergeCoverages(coverageFiles, tmpPath); const totalCoverage = lcovTotal(coverageFile);