Skip to content

Commit

Permalink
Merge pull request #3 from seriousben/prep-release
Browse files Browse the repository at this point in the history
  • Loading branch information
seriousben authored Jan 6, 2022
2 parents b80fd19 + 7ef83be commit bcc8b80
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,44 @@

This action runs [go-patch-cover](https://github.com/seriousben/go-patch-cover) to display test coverage for code changed within a pull request.

![Comment example](docs/comment-example.png#gh-dark-mode-only)
![Comment example](docs/comment-example-light.png#gh-light-mode-only)

## Permissions

- `pull-requests: write` for writing comments on pull requests.
- `contents: write` for the git-notes prev_coverage_mode to maintain the coverage within git notes.

## Usage

Just add `seriousben/go-patch-cover-action` as a step in your existing workflow.

A workflow might look like this:

```yaml
name: "CI"

on: ["push", "pull_request"]

permissions:
contents: write
pull-requests: write

jobs:
ci:
name: "Run CI"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: WillAbides/[email protected]
with:
go-version: "*"
- run: "go test -coverprofile=coverage.out -covermode=count ./..."
- uses: seriousben/[email protected]
with:
version: main
```
Please see [GitHub's documentation on Actions](https://docs.github.com/en/actions) for extensive
documentation on how to write and tweak workflows.
6 changes: 1 addition & 5 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Go Patch Coverage"
description: |
Display golang patch test coverage on your pull requests.
Required permissions:
- `pull-requests: write` for writing comments on pull requests.
- `contents: write` for the git-notes prev_coverage_mode to maintain the coverage within git notes.
author: "Benjamin Boudreau"
branding:
icon: "code"
Expand Down Expand Up @@ -149,4 +145,4 @@ runs:
git push origin refs/notes/coverage
shell: bash
env:
coverage_filename : ${{ inputs.coverage_filename }}
coverage_filename : ${{ inputs.coverage_filename }}
Binary file added docs/comment-example-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/comment-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bcc8b80

Please sign in to comment.