Skip to content

Commit

Permalink
Name and Update Comment options (vebr#11)
Browse files Browse the repository at this point in the history
* Name and Update Comment options

- Adds the ability to specifiy a name to add into the title. Good for
  monorepos or multiple workflows where you want to differentiate runs
- Adds the ability to update a comment instead of creating a new one
- Update dependencies

* Update README.md

* Update README.md

* Skip and log if event is not a pull request
  • Loading branch information
alexjfno1 authored Dec 8, 2020
1 parent af2176e commit eacce47
Show file tree
Hide file tree
Showing 10 changed files with 2,342 additions and 1,460 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ by another action already.
Github token used for posting the comment. To use the key provided by the GitHub
action runner, use `${{ secrets.GITHUB_TOKEN }}`.

##### `name` (**Optional**)
A name that will be included in the title of the comment. Good if you have multiple
reports being run and want to differentiate them.

##### `lcov-file` (**Optional**)
The location of the lcov file to read the coverage report from. Defaults to
`./coverage/lcov.info`.
Expand All @@ -23,6 +27,11 @@ The location of the lcov file to read the coverage report from. Defaults to
The location of the lcov file resulting from running the tests in the base
branch. When this is set a diff of the coverage percentages is shown.

##### `update-comment` (**Optional**)
If `true` the comment left on the PR will be updated (if one exists) with the new report data
instead of a new comment being created. If `false` every run will create a new comment on the PR
with the new data and keep the previous comments. Defaults to `false`.

## Example usage

```yml
Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@ inputs:
github-token:
description: Github token
required: true
name:
description: Name of report
required: false
default: ""
lcov-file:
description: The location of the lcov.info file
required: false
lcov-base:
description: The location of the lcov file for the base branch
required: false
update-comment:
description: Update the existing comment if it exists instead of creating a new one
required: false
default: false
runs:
using: node12
main: dist/main.js
Loading

0 comments on commit eacce47

Please sign in to comment.