Skip to content

Commit

Permalink
feat: add labelColor option. #35
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 4, 2024
1 parent daf59ef commit fdbd91b
Show file tree
Hide file tree
Showing 9 changed files with 3,197 additions and 1,468 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
uses: jaywcjlove/changelog-generator@main

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ You can add `![Coverage](./coverage/badges.svg)` to your README.md after the bad
- `source` - The path of the target file "coverage-summary.json".
- `output` - Output image path.
- `label` - The left label of the badge, usually static (default `coverage`).
- `labelColor` - \<Color RGB> or \<Color Name> (default: `555`).
- `scale` - Set badge scale (default: `1`).
- `style` - Badges style: `flat`, `classic` (default `classic`).
- ~~`type`~~ - (No longer supported after v1.2.0) Coverage report type: `lines`, `statements`, `functions`, `branches` (default `statements`)
- `jsonPath` - Path to the coverage percentage number to be used in the badge (default `total.statements.pct`)
Expand Down Expand Up @@ -123,16 +125,18 @@ Options:
--source, -s The path of the target file "coverage-summary.json".
--style Badges style: flat, flat-square.
--type Coverage type: lines, statements, functions, branches.
--scale Set badge scale (default: 1)
--icon Path to icon file
--iconWidth Set this if icon is not square (default: 13)
--label The left label of the badge, usually static (default `coverage`).
--labelColor <Color RGB> or <Color Name> (default: '555')

Example:

npm coverage-badges-cli --output coverage/badges.svg
npm coverage-badges-cli --style plastic
npm coverage-badges-cli --source coverage/coverage-summary.json
npm coverage-badges-cli --type lines
npm coverage-badges-cli --icon my-icon.svg
npm coverage-badges-cli --labelColor ADF
```
## Development
Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ inputs:
default: classic
required: false

scale:
description: 'Set badge scale (default: 1)'
default: "1"
required: false

labelColor:
description: '<Color RGB> or <Color Name> (default: '555')'
default: "555"
required: false

jsonPath:
description: 'Path to the coverage percentage number to be used in the badge'
default: total.lines.pct
Expand Down
Loading

0 comments on commit fdbd91b

Please sign in to comment.