Skip to content

Commit

Permalink
feat: added prefix_path input that can be used to add a prefix to eac…
Browse files Browse the repository at this point in the history
…h filename in the cobertura report
  • Loading branch information
kevinvalk committed Sep 8, 2022
1 parent ed49cc3 commit 2c37d7c
Show file tree
Hide file tree
Showing 6 changed files with 16,756 additions and 20,207 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ artifacts to circumvent this. See the workflows in this project for an implement

A comment is added to the pull request with the coverage report.

![alt text](img/comment.png "Pull request comment with metrics")
![alt text](img/comment.png 'Pull request comment with metrics')

A check is added to the workflow run.

![alt text](img/check.png "Check with metrics")
![alt text](img/check.png 'Check with metrics')

The check will succeed or fail based on your threshold when `fail_below_threshold` is set to `true`, this allows you to mandate coverage checks pass on your [protected branches](https://docs.github.com/en/github/administering-a-repository/defining-the-mergeability-of-pull-requests/about-protected-branches).

Expand All @@ -39,6 +39,10 @@ The GITHUB_TOKEN. Defaults to `${{github.token}}`

The path to the cobertura report. Defaults to `coverage.xml`. Glob pattern is supported, for example `coverage/*.xml`.

## `prefix_path`

This prefix is added to every `filename` within the cobertura report. This can resolve issues with `link_missing_lines` URLs and `only_changed_files`.

### `skip_covered`

If files with 100% coverage should be ignored. Defaults to `true`.
Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'Path to the cobertura file.'
required: true
default: 'coverage.xml'
prefix_path:
description: 'Prefix path to add to each filename.'
required: false
default: ''
skip_covered:
description: 'If files with 100% should be skipped from report.'
required: true
Expand Down Expand Up @@ -44,6 +48,11 @@ inputs:
description: 'Link missing line numbers.'
required: false
default: false
link_missing_lines_source_dir:
description: 'Source directory used for link_missing_lines.'
required: false
default: ''
deprecationMessage: 'Please switch to prefix_path instead (this input is forward to prefix_path).'
only_changed_files:
description: 'Only show coverage for changed files. (only if a PR is present)'
required: true
Expand Down
Loading

0 comments on commit 2c37d7c

Please sign in to comment.