Skip to content

Commit 767e21c

Browse files
oacikbartosz347
authored andcommitted
Add option to update the PR comment instead of creating a new one
1 parent 369eb1e commit 767e21c

File tree

5 files changed

+1528
-1454
lines changed

5 files changed

+1528
-1454
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ For more information on these inputs, see the [Workflow syntax for GitHub Action
1818
- `github-token`: Set the `${{ secrets.GITHUB_TOKEN }}` token to have the action comment the coverage summary in the pull request. This token is provided by Actions, you do not need to create your own token. Optional. Default: ``
1919
- `working-directory`: The working directory containing the source files referenced in the LCOV files. Optional. Default: `./`
2020
- `title-prefix`: A prefix before the title "LCOV of commit..." Optional. Default: ``
21+
- `update-comment`: Set to `true` to update previous code coverage comment if such exists. When set to `false` new comment is always created. Optional. Default: `false`
2122

2223
### Outputs
2324
None.
@@ -49,6 +50,7 @@ jobs:
4950
artifact-name: code-coverage-report
5051
github-token: ${{ secrets.GITHUB_TOKEN }}
5152
working-directory: apps/my-first-app
53+
update-comment: true
5254
```
5355
*Note:* Only the `pull_request` and `pull_request_target` events are supported. This action does nothing when triggered by other event types.
5456

@@ -57,4 +59,4 @@ jobs:
5759
This is used in my opinionated [GitHub Actions: Flutter Workflows](https://github.com/zgosalvez/github-actions-flutter-workflows) repository along with other actions for a complete end-to-end DevOps experience.
5860

5961
## License
60-
The scripts and documentation in this project are released under the [MIT License](LICENSE)
62+
The scripts and documentation in this project are released under the [MIT License](LICENSE)

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ inputs:
1919
title-prefix:
2020
description: 'A prefix before the title "LCOV of commit..." Optional. Default: ``'
2121
required: false
22+
update-comment:
23+
description: 'Update the existing comment if it exists instead of creating a new one'
24+
required: false
25+
default: "false"
2226
runs:
2327
using: 'node16'
2428
main: 'dist/main/index.js'
2529
post: 'dist/post/index.js'
2630
branding:
2731
icon: umbrella
28-
color: purple
32+
color: purple

0 commit comments

Comments
 (0)