Skip to content

Commit

Permalink
Fixes and improvements to v3 (#85)
Browse files Browse the repository at this point in the history
* Add option to update the PR comment instead of creating a new one

* Revert to previous lcov-total version to support CommonJS

* Adjust to changes in GitHub API package

* Allow defining custom message added to comment

* Fixes License link

* Minor formatting and copy changes

* Resolves conflicts

---------

Co-authored-by: Oguzcan Acik <[email protected]>
Co-authored-by: Zennon Gosalvez <[email protected]>
  • Loading branch information
3 people authored Feb 19, 2023
1 parent 1750a94 commit 53aba86
Show file tree
Hide file tree
Showing 10 changed files with 3,304 additions and 4,948 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ For more information on these inputs, see the [Workflow syntax for GitHub Action
- `minimum-coverage`: The minimum coverage to pass the check. Optional. Default: `0` (always passes)
- `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: ``
- `working-directory`: The working directory containing the source files referenced in the LCOV files. Optional. Default: `./`
- `title-prefix`: A prefix before the title "LCOV of commit..." Optional. Default: ``
- `title-prefix`: A prefix before the title "LCOV of commit...". Optional. Default: ``
- `additional-message`: Custom text appended to the code coverage comment in the pull request. Optional. Default: ``
- `update-comment`: Set to `true` to update the previous code coverage comment if such exists. When set to `false`, a new comment is always created. Optional. Default: `false`

### Outputs
- `total-coverage`: The total coverage from scanned files.
Expand Down Expand Up @@ -51,6 +53,7 @@ jobs:
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: apps/my-first-app
update-comment: true
```
*Note:* Only the `pull_request` and `pull_request_target` events are supported. This action does nothing when triggered by other event types.

Expand All @@ -59,4 +62,4 @@ jobs:
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.

## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)
The scripts and documentation in this project are released under the [MIT License](LICENSE.md)
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ inputs:
working-directory:
description: 'The working directory containing the source files referenced in the LCOV files. Optional. Default: `./`'
title-prefix:
description: 'A prefix before the title "LCOV of commit..." Optional. Default: ``'
description: 'A prefix before the title "LCOV of commit...". Optional. Default: ``'
required: false
additional-message:
description: 'Custom text appended to the code coverage comment in the pull request. Optional. Default: ``'
required: false
update-comment:
description: 'Set to `true` to update the previous code coverage comment if such exists. When set to `false`, a new comment is always created. Optional. Default: `false`'
required: false
default: "false"
outputs:
total-coverage:
description: 'The total coverage from scanned files.'
Expand Down
Loading

0 comments on commit 53aba86

Please sign in to comment.