farhan-ahmed1/HanCover Action
Generate comprehensive coverage reports for Pull Requests with intelligent change detection and dynamic badges. Features: • Multi-format support: Automatically detects LCOV, Cobertura, JaCoCo, and Clover coverage files • Smart PR comments: Single sticky comment that updates with each push - no spam • Change tracking: Compares PR coverage against main branch with visual delta indicators • Dynamic badges: Auto-updating coverage and change badges via GitHub Gists or file storage • Package organization: Intelligent grouping with customizable package structure • Security focused: Minimal permissions, input validation, and secure parsing • Security focused: Minimal permissions, input validation, and secure XML processing • Threshold validation: Configurable coverage requirements with clear pass/fail indicators Perfect for JavaScript/TypeScript (Jest, Vitest), .NET, Java (Maven), Python, PHP, and monorepo projects.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| files | Coverage file patterns (e.g., 'coverage/lcov.info', '**/cobertura.xml') | yes | — |
| github-token | GitHub token for PR comments and GitHub API access (defaults to GITHUB_TOKEN) | no | — |
| gist-token | GitHub token with 'gist' scope for baseline storage | no | — |
| gist-id | GitHub Gist ID for storing baseline coverage data (enables change badges) | no | — |
| min-threshold | Minimum coverage threshold for health indicators (default: 50) | no | 50 |
| comment-mode | 'update' (sticky comment) or 'new' (always create new) | no | update |
| warn-only | If true, don't fail the action on coverage threshold violations | no | false |
| baseline-files | Baseline coverage files for comparison (alternative to gist-id) | no | — |
| groups | YAML configuration for custom package grouping | no | — |
| thresholds | Coverage thresholds (e.g., 'total:80\ndiff:75') | no | — |
Outputs
| name | description |
|---|---|
| coverage-pct | Overall project coverage percentage |
| changes-coverage-pct | Coverage percentage for code changes in this PR |
| coverage-delta | Coverage change compared to main branch (when gist-id provided) |