1+ [ ![ CI] ( https://github.com/tj-actions/coverage-badge-py/actions/workflows/test.yml/badge.svg )] ( https://github.com/tj-actions/coverage-badge-py/actions/workflows/test.yml ) [ ![ Update release version.] ( https://github.com/tj-actions/coverage-badge-py/actions/workflows/sync-release-version.yml/badge.svg )] ( https://github.com/tj-actions/coverage-badge-py/actions/workflows/sync-release-version.yml )
2+
13coverage-badge-py
24-----------------
35
4- Generate coverage.py badge
5-
6- Sample badge:
7-
8- ![ coverage badge] ( ./coverage.svg )
6+ Generate coverage.py badge like this ![ coverage badge] ( ./coverage.svg ) without uploading results to a 3rd party site.
97
108## Usage:
119
@@ -14,7 +12,7 @@ Sample badge:
1412 steps :
1513 - uses : actions/checkout@v2
1614 - name : Coverage Badge
17- uses : tj-actions/coverage-badge-py@v1
15+ uses : tj-actions/coverage-badge-py@v1.1
1816` ` `
1917
2018> NOTE: :warning:
@@ -24,17 +22,43 @@ Sample badge:
2422
2523| Input | type | required | default | description |
2624|:-------------:|:-----------:|:-------------:|:----------------------------:|:-------------:|
27- | token | ` string` | `true` | `${{ github.token }}` | [GITHUB_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
28- | output | `string` | `true` | `coverage.svg ` | The output path for the generated coverage badge. |
25+ | output | ` string` | `true` | `coverage.svg` | The output path for <br /> the generated coverage badge. |
26+ | overwrite | `string` | `true` | `'true' ` | Boolean string used to <br /> determine wheter to overwrite <br /> an existing badge. |
2927
3028
3129
32- * Free software: [MIT license](LICENSE)
30+ # ## Example
3331
34- Features
35- --------
32+ ` ` ` yml
33+ ...
34+ steps:
35+ - uses: actions/checkout@v2
36+ - name: Coverage Badge
37+ uses: tj-actions/coverage-badge-py@v1.1
38+ - name: Verify Changed files
39+ uses: tj-actions/verify-changed-files@v5.1
40+ id: changed_files
41+ with:
42+ files: coverage.svg
43+
44+ - name: Commit files
45+ if: steps.changed_files.outputs.files_changed == 'true'
46+ run: |
47+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
48+ git config --local user.name "github-actions[bot]"
49+ git add coverage.svg
50+ git commit -m "Updated coverage.svg"
51+
52+ - name: Push changes
53+ if: steps.changed_files.outputs.files_changed == 'true'
54+ uses: ad-m/github-push-action@master
55+ with:
56+ github_token: ${{ secrets.github_token }}
57+ branch: ${{ github.ref }}
58+ ` ` `
3659
37- * TODO
60+
61+ * Free software: [MIT license](LICENSE)
3862
3963
4064Credits
0 commit comments