Skip to content

Commit fbd4073

Browse files
Fix undefined exception by checking if artifact exists
1 parent a4dc6cc commit fbd4073

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ inputs:
3232
outputs:
3333
total-coverage:
3434
description: 'The total coverage from scanned files.'
35+
artifact-id:
36+
description: 'The GitHub artifact id for the generated HTML report.'
3537

3638
runs:
3739
using: 'node24'

dist/main/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async function run() {
5858
}
5959

6060
core.setOutput("total-coverage", totalCoverage);
61-
core.setOutput('artifact-id', artifact.id);
61+
core.setOutput('artifact-id', artifact ? artifact.id : null);
6262

6363
if (!isMinimumCoverageReached) {
6464
throw Error(errorMessage);

0 commit comments

Comments
 (0)