Skip to content
 
 

Repository files navigation

📛 badge-generator

Latest Release Stars Forks Coverage

badge-generator is a GitHub Action that creates dynamic, customizable badges using Shields.io. Perfect for displaying code coverage, build status, quality metrics, or any custom label and value in your repository.

🚀 Quick Usage

Add the following step to your workflow file (e.g. .github/workflows/ci.yml):

# Example
- name: Generate coverage badge
  uses: ernanej/badge-generator@main
  with:
    name: '98.7%'
    prefix: 'coverage'
    icon: 'jest'
    color: 'green'
    style: 'flat-square'
    path: 'badges/coverage.svg'
    branch: 'badge'

👉 See more examples in examples/README.md

Input Required Description
name Right-hand side value (e.g. "98.7%")
prefix Left-hand label (e.g. "coverage")
icon Icon name (e.g. jest, github, codecov, etc.)
color Badge color (e.g. green, #ffaa00)
style Badge style (flat, flat-square, plastic, etc.)
labelColor Label background color
logoColor Icon/logo color
link URL or comma-separated URLs the badge should link to
cacheSeconds Cache duration (seconds) for badge
path Local file path where badge will be saved (e.g. badges/coverage.svg)
badge_branch Branch where the badge will be committed (default: badge-generator)
main_branch The main branch name (default: main)
github_token GitHub token (required for PR comments)

🛠️ Local Development

npm install
npm run build
node local-test.js   # Test the action locally

🙏 Acknowledgements

This project uses the awesome Shields.io service to generate dynamic badge images. If you find it useful, consider supporting their open-source work.

📄 License

MIT © Ernane Ferreira

About

Fork of ErnaneJ/badge-generator used for an upstream contribution merged in PR #4.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages