Skip to content

Commit eacce47

Browse files
authored
Name and Update Comment options (vebr#11)
* 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
1 parent af2176e commit eacce47

File tree

10 files changed

+2342
-1460
lines changed

10 files changed

+2342
-1460
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ by another action already.
1515
Github token used for posting the comment. To use the key provided by the GitHub
1616
action runner, use `${{ secrets.GITHUB_TOKEN }}`.
1717

18+
##### `name` (**Optional**)
19+
A name that will be included in the title of the comment. Good if you have multiple
20+
reports being run and want to differentiate them.
21+
1822
##### `lcov-file` (**Optional**)
1923
The location of the lcov file to read the coverage report from. Defaults to
2024
`./coverage/lcov.info`.
@@ -23,6 +27,11 @@ The location of the lcov file to read the coverage report from. Defaults to
2327
The location of the lcov file resulting from running the tests in the base
2428
branch. When this is set a diff of the coverage percentages is shown.
2529

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

2837
```yml

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,20 @@ inputs:
88
github-token:
99
description: Github token
1010
required: true
11+
name:
12+
description: Name of report
13+
required: false
14+
default: ""
1115
lcov-file:
1216
description: The location of the lcov.info file
1317
required: false
1418
lcov-base:
1519
description: The location of the lcov file for the base branch
1620
required: false
21+
update-comment:
22+
description: Update the existing comment if it exists instead of creating a new one
23+
required: false
24+
default: false
1725
runs:
1826
using: node12
1927
main: dist/main.js

0 commit comments

Comments
 (0)