Skip to content

Commit 8b36411

Browse files
Add outputs to README
1 parent db98460 commit 8b36411

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,28 @@ jobs:
346346
path: python-coverage-comment-action.txt
347347
```
348348
349+
### Outputs
350+
351+
The action makes available some data for downstream processing:
352+
353+
- COMMENT_FILE_WRITTEN: A boolean indicating whether a comment file was written to COMMENT_FILENAME or not. Only set when running in PR mode.
354+
- COVERAGE_PERCENTAGE: The coverage percentage of the pull request.
355+
- REFERENCE_COVERAGE_PERCENTAGE: The coverage percentage of the base branch.
356+
357+
Usage may look like this
358+
359+
```yaml
360+
- name: Coverage comment
361+
id: coverage_comment
362+
uses: py-cov-action/python-coverage-comment-action@v3
363+
with:
364+
GITHUB_TOKEN: ${{ github.token }}
365+
366+
- name: Enforce coverage
367+
if: ${{ steps.coverage_comment.outputs.COVERAGE_PERCENTAGE < steps.coverage_comment.outputs.REFERENCE_COVERAGE_PERCENTAGE }}
368+
run: echo "Coverage decreased." && exit 1
369+
```
370+
349371
### All options
350372
351373
```yaml

0 commit comments

Comments
 (0)