No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
github-actions[bot] 219e7aab43
Updated README.md (#177)
* Updated README.md

* Update README.md

* Update README.md

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tonye Jack <jtonye@ymail.com>
2025-08-13 19:36:00 -06:00
.github Update update-readme.yml 2025-08-13 19:21:42 -06:00
test_package Removed igored files 2023-03-06 21:05:56 +00:00
.all-contributorsrc docs: add boidolr as a contributor for doc (#168) 2024-05-26 18:48:04 -06:00
.gitignore Update .gitignore 2023-03-06 14:04:21 -07:00
.whitesource Added .whitesource 2021-07-02 12:52:34 -04:00
action.yml fix: installation error (#174) 2025-06-15 00:23:05 -06:00
CODE_OF_CONDUCT.md Added CODE_OF_CONDUCT.md 2021-07-02 16:43:52 -04:00
CONTRIBUTING.md Initial commit 2021-03-25 07:29:32 -04:00
coverage.svg Updated README and coverage data. 2021-03-25 08:00:47 -04:00
HISTORY.md Upgraded from v2.0.3 -> v2.0.4 (#176) 2025-06-19 15:24:20 -06:00
LICENSE Initial commit 2021-03-25 07:29:32 -04:00
README.md Updated README.md (#177) 2025-08-13 19:36:00 -06:00

Ubuntu Mac OS Windows Public workflows that use this action.

Codacy Badge CI Update release version.

All Contributors

coverage-badge-py

Generate coverage.py badge like this coverage badge without uploading results to a 3rd party site.

Usage:

...
    steps:
      - uses: actions/checkout@v4
      - name: Coverage Badge
        uses: tj-actions/coverage-badge-py@v2

[!Warning]

  • It's important that you run this action from the directory where the .coverage data file is located.

If you feel generous and want to show some extra appreciation:

Support this project with a

Buy me a coffee

Inputs

- uses: tj-actions/coverage-badge-py@1788babcb24544eb5bbb6e0d374df5d1e54e670f # v2
  id: coverage-badge-py
  with:
    # Output path to write the 
    # coverage badge. 
    # Type: string
    # Default: "coverage.svg"
    output: ''

    # Overwrite an existing coverage badge.
    # Type: boolean
    # Default: "true"
    overwrite: ''

    # Current working directory
    # Type: string
    # Default: "."
    working-directory: ''

Example

...
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4

      - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
        with:
          python-version: 3.13

      - name: Install dependencies
        ...

      - name: Run coverage
        run: |
          coverage run ...
          coverage report -m

      - name: Coverage Badge
        uses: tj-actions/coverage-badge-py@1788babcb24544eb5bbb6e0d374df5d1e54e670f # v2

      - name: Verify Changed files
        uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20
        id: verify-changed-files
        with:
          files: coverage.svg

      - name: Commit files
        if: steps.verify-changed-files.outputs.files_changed == 'true'
        run: |
          git config --local user.email "github-actions[bot]@users.noreply.github.com"
          git config --local user.name "github-actions[bot]"
          git add coverage.svg
          git commit -m "Updated coverage.svg"

      - name: Push changes
        if: steps.verify-changed-files.outputs.files_changed == 'true'
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.github_token }}
          branch: ${{ github.ref }}

Credits

This package was created with Cookiecutter.

Report Bugs

Report bugs at https://github.com/tj-actions/coverage-badge-py/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your workflow that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Contributors

Thanks goes to these wonderful people (emoji key):

Raphael Boidol
Raphael Boidol

📖

This project follows the all-contributors specification. Contributions of any kind welcome!