Skip to content

Commit f2d7d4f

Browse files
authored
Merge branch 'main' into test
2 parents aa30d91 + 2437b0b commit f2d7d4f

File tree

11 files changed

+193
-50
lines changed

11 files changed

+193
-50
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin/* linguist-generated

.github/workflows/summary-example.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: example of summary
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
build:
7+
name: example of workflow
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@master
12+
13+
- name: clover file to comment (clover.example.base.xml)
14+
uses: ./.
15+
with:
16+
dir-prefix: /var/www/html
17+
file: clover.example.base.xml
18+
base-file: clover.example.xml
19+
chart-size: 75
20+
only-with-cover: true
21+
signature: "summary example"

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [0.13.0] - 2024-03-20
10+
11+
### Added
12+
13+
- explanation about forks and token permissions with them.
14+
- new option `skip-comments-on-forks` to prevent blocking pull requests from forks because of lack of
15+
permissions.
16+
17+
### Changed
18+
19+
- improving error reporting for debugging purposes
20+
921
## [0.12.0] - 2024-02-02
1022

1123
### Added
@@ -240,7 +252,8 @@ as bundling tool.
240252
- implemented base action reading clover.xml files and converting then.
241253
- release.yml workflow to auto-release tags
242254

243-
[Unreleased]: https://github.com/lucassabreu/comment-coverage-clover/compare/v0.12.0...HEAD
255+
[Unreleased]: https://github.com/lucassabreu/comment-coverage-clover/compare/v0.13.0...HEAD
256+
[0.13.0]: https://github.com/lucassabreu/comment-coverage-clover/compare/v0.12.0...v0.13.0
244257
[0.12.0]: https://github.com/lucassabreu/comment-coverage-clover/compare/v0.11.0...v0.12.0
245258
[0.11.0]: https://github.com/lucassabreu/comment-coverage-clover/compare/v0.10.2...v0.11.0
246259
[0.10.4]: https://github.com/lucassabreu/comment-coverage-clover/compare/v0.10.1...v0.10.2

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Configuration
5454
| `table-coverage-change` | Show only files which their coverage changed equal or above this percentage <br/> Default: `0` |
5555
| `signature` | Custom signature to be used at the bottom of the comment. <br/>If you need multiple comments per pull request each step needs to have a unique `signature` |
5656
| `github-token` | Custom [PAT][pat] to be used instead of the [default action token][default-token], should have the `repo` scope |
57+
| `skip-comments-on-forks` | Should skip trying to comment on [pull requests created from forks](#restrictions-on-forks) <br/> Default: `false` |
5758

5859
Example usage
5960
-------------
@@ -155,10 +156,25 @@ jobs:
155156
base-file: tests/base/coverage.xml
156157
```
157158
159+
Restrictions on Forks
160+
---------------------
161+
162+
Github Actions [imposes higher Restrictions on workflows triggered from forks in public repositories][fork],
163+
where the default token generated will have only read permissions.
164+
165+
Because of that when this Action is run on pull requests from forks no comment will be created with the
166+
coverage report, instead the report will only be shown at the steps summary.
167+
168+
![example of step summary with the report](./assets/summary-example.png)
169+
170+
If comments on pull request from forks are required for your workflow a [PAT][pat] can be used, but be aware
171+
that doing that may open the owner of the PAT to the malicious intentions of the internet.
172+
158173
[CHANGELOG](CHANGELOG.md)
159174
---------
160175
161176
[danhunsaker/clover-reporter-action]: https://github.com/danhunsaker/clover-reporter-action
162177
[pat]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
163178
[lang]: https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl#argumento_locales
164179
[default-token]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
180+
[fork]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ inputs:
7373
signature:
7474
description: Custom signature to be used at the bottom of the comment
7575
required: false
76+
skip-comments-on-forks:
77+
description: Should skip trying to comment on pull requests created from forks
78+
default: false
79+
7680
runs:
7781
using: node20
7882
main: bin/index.js

assets/summary-example.png

50 KB
Loading

bin/index.js

Lines changed: 69 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@rollup/plugin-json": "^4.1.0",
2525
"@rollup/plugin-node-resolve": "^13.3.0",
2626
"prettier": "^2.7.1",
27-
"rollup": "^2.78.0",
27+
"rollup": "^3.29.5",
2828
"rollup-plugin-node-externals": "^4.1.1",
2929
"rollup-plugin-typescript2": "^0.35.0"
3030
}

0 commit comments

Comments
 (0)