https://github.com/drew2a/annotate-coverage-action
GitHub Action for adding annotations for uncovered lines in PRs
https://github.com/drew2a/annotate-coverage-action
Last synced: 20 days ago
JSON representation
GitHub Action for adding annotations for uncovered lines in PRs
- Host: GitHub
- URL: https://github.com/drew2a/annotate-coverage-action
- Owner: drew2a
- License: mit
- Created: 2025-02-19T12:41:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-19T14:11:57.000Z (over 1 year ago)
- Last Synced: 2025-02-19T14:27:26.850Z (over 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/drew2a/annotate-coverage-action/actions/workflows/ci.yml)
# Annotate Coverage Action
This GitHub Action adds annotations for uncovered lines in PRs based on a coverage report.
# What's new
Please refer to the [release page](https://github.com/drew2a/annotate-coverage-action/releases/latest) for the latest release notes.
# Usage
```yaml
- uses: drew2a/annotate-coverage-action@v1
with:
# Path to the JSON coverage report generated by diff-cover
# Required
json_path: "diff_coverage.json"
```
### Example of usage
```yaml
- name: Run Tests
run: |
poetry run pytest --cov --cov-report=xml --cov-report=term-missing
- name: Compare coverage
run: |
poetry run diff-cover coverage.xml --compare-branch=origin/main --json-report=diff_coverage.json
- name: Annotate uncovered lines
uses: drew2a/annotate-coverage-action@v1
with:
json_path: "diff_coverage.json"
```
### Example of added annotations

# License
The scripts and documentation in this project are released under the [MIT License](LICENSE)