Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional action output #598

Merged
merged 2 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ jobs:
| `update_check` | Optional. Uses an alternative API to update checks, use for cases with more than 50 annotations. |
| `annotate_only` | Optional. Will only annotate the results on the files, won't create a check run. |

### Action outputs

After action execution it will return the test counts as output.

```yml
# ${{steps.{CHANGELOG_STEP_ID}.outputs.total}}
```

A full set list of possible output values for this action.

| **Output** | **Description** |
|-----------------------|----------------------------------------------------------------------------------------|
| `outputs.total` | The total number of test cases covered by this test-step. |
| `outputs.passed` | The number of passed test cases. |
| `outputs.skipped` | The number of skipped test cases. |
| `outputs.failed` | Then umber of failed test cases. |

## Sample 🖥️

<div align="center">
Expand Down
2 changes: 2 additions & 0 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.

2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export async function run(): Promise<void> {
).length
const passed = testResult.count - failed - testResult.skipped

core.setOutput('total', testResult.count)
core.setOutput('passed', passed)
core.setOutput('skipped', testResult.skipped)
core.setOutput('failed', failed)

let title = 'No test results found!'
Expand Down