Skip to content

Commit

Permalink
add add-comment input option
Browse files Browse the repository at this point in the history
  • Loading branch information
gwatts committed May 15, 2022
1 parent 8ca580c commit 1784c8d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 4 additions & 0 deletions action.yml
Expand Up @@ -30,6 +30,10 @@ inputs:
description: 'Fail the build if coverage drops below coverage-threshold. One of "always", "never" or "only_pull_requests"'
required: false
default: only_pull_requests
add-comment:
description: 'Adds a comment to the PR with coverage information if true. If false will only add an action summary report.'
required: false
default: true
outputs:
report-pathname:
description: 'The full pathname of the generated coverage report'
Expand Down
11 changes: 6 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions index.js
Expand Up @@ -302,11 +302,12 @@ async function generateReport() {



if (ctx.payload.pull_request) {
const comment = await generatePRComment(stats);
await core.summary
.addRaw(comment)
.write();
const comment = await generatePRComment(stats);
await core.summary
.addRaw(comment)
.write();

if (core.getBooleanInput('add-comment') && ctx.payload.pull_request) {
const token = core.getInput('token');
const octokit = github.getOctokit(token);
const pr_number = ctx.payload.pull_request.number;
Expand Down

0 comments on commit 1784c8d

Please sign in to comment.