Skip to content

Commit aa8a559

Browse files
authored
Merge pull request #58 from lucassabreu/feat/allow-custom-icons
feat: allow custom icons
2 parents 28e92c5 + 65655b4 commit aa8a559

File tree

8 files changed

+156
-63
lines changed

8 files changed

+156
-63
lines changed

.github/workflows/example.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,31 @@ jobs:
249249
with-branches: false
250250
signature: "comment using a pat"
251251
github-token: ${{ secrets.PAT }}
252+
253+
- name: comment using custom icons
254+
uses: ./.
255+
with:
256+
dir-prefix: /var/www/html
257+
file: clover.onepackage.xml
258+
base-file: clover.onepackage.base.xml
259+
with-chart: true
260+
show-percentage-change-on-table: true
261+
signature: "comment using custom icons"
262+
icon-equals: ":eject_button:"
263+
icon-increased: ":arrow_upper_right:"
264+
icon-decreased: ":arrow_lower_right:"
265+
icon-new: ":checkered_flag:"
266+
267+
- name: comment using text instead of icons
268+
uses: ./.
269+
with:
270+
dir-prefix: /var/www/html
271+
file: clover.onepackage.xml
272+
base-file: clover.onepackage.base.xml
273+
with-chart: true
274+
show-percentage-change-on-table: true
275+
icon-equals: "(same)"
276+
icon-increased: "(increased)"
277+
icon-decreased: "(decreased)"
278+
icon-new: "(new)"
279+
signature: "comment using text instead of icons"

README.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,35 @@ File: `clover.example.base.xml`
3030
Configuration
3131
-------------
3232

33-
| Input | Description |
34-
|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
35-
| `file` | The location of the clover file. <br/> **Required** |
36-
| `base-file` | The location of the clover file with a previous state of the coverage to compare |
37-
| `dir-prefix` | Section of the file on clover report to remove <br/> Default: `github.workspace` <br/> **Required** |
38-
| `dir-prefix-keep` | Section of the `dir-prefix` to keep when creating link to file.<br/>Example: if your php application is at "$REPO/backend", then you should set this to "backend" |
39-
| `only-with-cover` | Should only list files with at least one line covered. |
40-
| `only-with-coverable-lines` | Should only list files with at least one "coverable" line of code<br/>Example: interfaces or abstract classes with no implementation |
41-
| `lang` | In which [language][lang] to format the numbers <br/> Default: `en-US` |
42-
| `chart-size` | How many characters to use on chart's bar<br/> Default: `23` |
43-
| `with-chart` | Add a chart with the distribution of coverage on files<br/> Default: `true` |
44-
| `max-line-coverage-decrease` | How much the line coverage percentage can decrease without failing |
45-
| `max-method-coverage-decrease` | How much the method coverage percentage can decrease without failing |
46-
| `min-line-coverage` | Minimum percentage acceptable for line coverage <br/> Default: `0` |
47-
| `min-method-coverage` | Minimum percentage acceptable for method coverage <br/>Default `0` |
48-
| `with-table` | Add a table with a list of files and its coverage <br/> Default: `true` |
49-
| `with-branches` | Adds the column "Branches" with the branching coverage <br/> Default: `true` |
50-
| `show-percentage-change-on-table` | Show in percentage how much the file coverage changed per file |
51-
| `table-type-coverage` | Which of the coverage percentages to filter <br/> Default: `"lines"` |
52-
| `table-below-coverage` | Show only files below or equal to this coverage percentage <br/> Default: `100` |
53-
| `table-above-coverage` | Show only files above or equal to this coverage percentage <br/> Default: `0` |
54-
| `table-coverage-change` | Show only files which their coverage changed equal or above this percentage <br/> Default: `0` |
55-
| `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` |
56-
| `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` |
33+
| Input | Description |
34+
|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
35+
| `file` | The location of the clover file. <br/> **Required** |
36+
| `base-file` | The location of the clover file with a previous state of the coverage to compare |
37+
| `dir-prefix` | Section of the file on clover report to remove <br/> Default: `github.workspace` <br/> **Required** |
38+
| `dir-prefix-keep` | Section of the `dir-prefix` to keep when creating link to file.<br/>Example: if your php application is at "$REPO/backend", then you should set this to "backend" |
39+
| `only-with-cover` | Should only list files with at least one line covered. |
40+
| `only-with-coverable-lines` | Should only list files with at least one "coverable" line of code<br/>Example: interfaces or abstract classes with no implementation |
41+
| `lang` | In which [language][lang] to format the numbers <br/> Default: `en-US` |
42+
| `chart-size` | How many characters to use on chart's bar<br/> Default: `23` |
43+
| `with-chart` | Add a chart with the distribution of coverage on files<br/> Default: `true` |
44+
| `max-line-coverage-decrease` | How much the line coverage percentage can decrease without failing |
45+
| `max-method-coverage-decrease` | How much the method coverage percentage can decrease without failing |
46+
| `min-line-coverage` | Minimum percentage acceptable for line coverage <br/> Default: `0` |
47+
| `min-method-coverage` | Minimum percentage acceptable for method coverage <br/>Default `0` |
48+
| `with-table` | Add a table with a list of files and its coverage <br/> Default: `true` |
49+
| `with-branches` | Adds the column "Branches" with the branching coverage <br/> Default: `true` |
50+
| `show-percentage-change-on-table` | Show in percentage how much the file coverage changed per file |
51+
| `table-type-coverage` | Which of the coverage percentages to filter <br/> Default: `"lines"` |
52+
| `table-below-coverage` | Show only files below or equal to this coverage percentage <br/> Default: `100` |
53+
| `table-above-coverage` | Show only files above or equal to this coverage percentage <br/> Default: `0` |
54+
| `table-coverage-change` | Show only files which their coverage changed equal or above this percentage <br/> Default: `0` |
55+
| `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` |
56+
| `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` |
58+
| `icon-equals` | Emoji/text to be used when the coverage diff is zero <br/> Default: `:stop_button:` |
59+
| `icon-increased` | Emoji/text to be used when the coverage diff is increased <br/> Default: `:stop_up_small:` |
60+
| `icon-decreased` | Emoji/text to be used when the coverage diff is decreased <br/> Default: `:stop_down_small:` |
61+
| `icon-new` | Emoji/text to be used when the file file is new, and does not have previous coverage metrics to compare <br/> Default: `:new:` |
5862

5963
Example usage
6064
-------------

action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ inputs:
7676
skip-comments-on-forks:
7777
description: Should skip trying to comment on pull requests created from forks
7878
default: false
79+
icon-equals:
80+
description: Emoji/text to be used when the coverage diff is zero
81+
default: ":stop_button:"
82+
icon-increased:
83+
description: Emoji/text to be used when the coverage diff is increased
84+
default: ":stop_up_small:"
85+
icon-decreased:
86+
description: Emoji/text to be used when the coverage diff is decreased
87+
default: ":stop_down_small:"
88+
icon-new:
89+
description: Emoji/text to be used when the file file is new, and does not have previous coverage metrics to compare
90+
default: ":new:"
7991

8092
runs:
8193
using: node20

bin/index.js

Lines changed: 27 additions & 18 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.

0 commit comments

Comments
 (0)