Skip to content

Commit bcc8b80

Browse files
authored
Merge pull request #3 from seriousben/prep-release
2 parents b80fd19 + 7ef83be commit bcc8b80

File tree

4 files changed

+42
-5
lines changed

4 files changed

+42
-5
lines changed

Diff for: README.md

+41
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,44 @@
22

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

5+
![Comment example](docs/comment-example.png#gh-dark-mode-only)
6+
![Comment example](docs/comment-example-light.png#gh-light-mode-only)
7+
8+
## Permissions
9+
10+
- `pull-requests: write` for writing comments on pull requests.
11+
- `contents: write` for the git-notes prev_coverage_mode to maintain the coverage within git notes.
12+
13+
## Usage
14+
15+
Just add `seriousben/go-patch-cover-action` as a step in your existing workflow.
16+
17+
A workflow might look like this:
18+
19+
```yaml
20+
name: "CI"
21+
22+
on: ["push", "pull_request"]
23+
24+
permissions:
25+
contents: write
26+
pull-requests: write
27+
28+
jobs:
29+
ci:
30+
name: "Run CI"
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: WillAbides/[email protected]
35+
with:
36+
go-version: "*"
37+
- run: "go test -coverprofile=coverage.out -covermode=count ./..."
38+
- uses: seriousben/[email protected]
39+
with:
40+
version: main
41+
```
42+
43+
Please see [GitHub's documentation on Actions](https://docs.github.com/en/actions) for extensive
44+
documentation on how to write and tweak workflows.
45+

Diff for: action.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: "Go Patch Coverage"
22
description: |
33
Display golang patch test coverage on your pull requests.
4-
5-
Required permissions:
6-
- `pull-requests: write` for writing comments on pull requests.
7-
- `contents: write` for the git-notes prev_coverage_mode to maintain the coverage within git notes.
84
author: "Benjamin Boudreau"
95
branding:
106
icon: "code"
@@ -149,4 +145,4 @@ runs:
149145
git push origin refs/notes/coverage
150146
shell: bash
151147
env:
152-
coverage_filename : ${{ inputs.coverage_filename }}
148+
coverage_filename : ${{ inputs.coverage_filename }}

Diff for: docs/comment-example-light.png

68.6 KB
Loading

Diff for: docs/comment-example.png

67.3 KB
Loading

0 commit comments

Comments
 (0)