Skip to content

Commit

Permalink
setup outputs (#15)
Browse files Browse the repository at this point in the history
* setup outputs

* update setup-node

* format
  • Loading branch information
michaelst authored Jul 18, 2023
1 parent 71e1c3f commit 0265f0e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3
with:
node-version: 16.x

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ jobs:

- `github_token`: (Required) Access from `${{ secrets.GITHUB_TOKEN }}`

## Outputs

- `covered`: Number of lines covered.

- `relevant`: Number of lines considered relevant.

- `percentage`: The coverage percentage.

## Add the coverage badge to your README.md

```markdown
Expand Down
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11754,6 +11754,9 @@ function run() {
// changedFiles only currently supported for PRs
const changedFiles = github.context.eventName === "pull_request" ? yield (0, changed_files_1.getChangedFiles)(octokit) : {};
const { covered, coveredForPatch, relevant, relevantForPatch, percentage, patchPercentage, annotations } = yield (0, parse_1.parse)(format, file, changedFiles, subdirectory);
core.setOutput("covered", covered);
core.setOutput("relevant", relevant);
core.setOutput("percentage", percentage);
const payload = {
covered,
relevant,
Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ async function run(): Promise<void> {
const { covered, coveredForPatch, relevant, relevantForPatch, percentage, patchPercentage, annotations } =
await parse(format, file, changedFiles, subdirectory)

core.setOutput("covered", covered)
core.setOutput("relevant", relevant)
core.setOutput("percentage", percentage)

const payload = {
covered,
relevant,
Expand Down

0 comments on commit 0265f0e

Please sign in to comment.