Skip to content

Latest commit

 

History

History
297 lines (235 loc) · 6.25 KB

File metadata and controls

297 lines (235 loc) · 6.25 KB

📘 — Badge Generator Usage Examples

This file showcases different use cases for the badge-generator GitHub Action, using Shields.io to create custom SVG badges.

For more examples, icons and customization check out the shields documentation at https://shields.io/docs and various action attributes.

✅ 1. Basic coverage badge

Coverage

- name: Generate badge
  uses: ernanej/badge-generator@main
  with:
    name: '98.7%'
    prefix: 'coverage'
    color: 'green'
    path: 'badges/coverage.svg'

🎨 2. Flat-square style with icon

Tests

- name: Coverage with style and icon
  uses: ernanej/badge-generator@main
  with:
    name: '95.2%'
    prefix: 'tests'
    icon: 'jest'
    color: 'blue'
    style: 'flat-square'
    path: 'badges/tests.svg'

🔗 3. Badge with hyperlink

Build

- name: Badge with link
  uses: ernanej/badge-generator@main
  with:
    name: 'PASSING'
    prefix: 'build'
    color: 'brightgreen'
    link: 'https://github.com/ernanej/badge-generator/actions'
    path: 'badges/build.svg'

🏷️ 4. Custom label color

Quality

- name: Custom label color
  uses: ernanej/badge-generator@main
  with:
    name: '90%'
    prefix: 'quality'
    color: 'orange'
    labelColor: '#333'
    path: 'badges/quality.svg'

🧪 5. Custom icon with logo color

Tests

- name: Icon with logo color
  uses: ernanej/badge-generator@main
  with:
    name: '100%'
    prefix: 'tests'
    icon: 'mocha'
    logoColor: 'red'
    color: 'purple'
    path: 'badges/mocha-tests.svg'

🕓 6. Cached badge

Release

- name: Cached badge
  uses: ernanej/badge-generator@main
  with:
    name: 'stable'
    prefix: 'release'
    color: 'blue'
    cacheSeconds: '3600'
    path: 'badges/release.svg'

📦 7. Version badge

Version

- name: Version badge
  uses: ernanej/badge-generator@main
  with:
    name: 'v1.3.0'
    prefix: 'version'
    color: 'informational'
    style: 'plastic'
    path: 'badges/version.svg'

💡 8. Badge with hex color

Coverage

- name: Hex color badge
  uses: ernanej/badge-generator@main
  with:
    name: '98%'
    prefix: 'coverage'
    color: '#ff5733'
    path: 'badges/hex-coverage.svg'

🧩 9. Multi-link badge

Issues

- name: Multi-link badge
  uses: ernanej/badge-generator@main
  with:
    name: 'open'
    prefix: 'issues'
    color: 'red'
    link: 'https://github.com/ernanej/badge-generator/issues,https://shields.io'
    path: 'badges/issues.svg'

🛠️ 10. Minimalistic badge

Status

- name: Minimal badge
  uses: ernanej/badge-generator@main
  with:
    name: 'ok'
    prefix: 'status'
    color: 'green'
    path: 'badges/status.svg'

📘 11. For-the-badge style

Docs

- name: For-the-badge style
  uses: ernanej/badge-generator@main
  with:
    name: 'available'
    prefix: 'docs'
    color: 'blue'
    style: 'for-the-badge'
    path: 'badges/docs.svg'

🧰 12. Social-style badge

Follow

- name: Social-style badge
  uses: ernanej/badge-generator@main
  with:
    name: '@ernanej'
    prefix: 'follow'
    icon: 'twitter'
    color: '1DA1F2'
    style: 'social'
    path: 'badges/twitter.svg'

🔒 13. License badge

License

- name: License badge
  uses: ernanej/badge-generator@main
  with:
    name: 'MIT'
    prefix: 'license'
    color: 'blue'
    path: 'badges/license.svg'

🚀 14. Build badge

Build

- name: Build badge
  uses: ernanej/badge-generator@main
  with:
    name: 'passing'
    prefix: 'build'
    color: 'brightgreen'
    path: 'badges/build-status.svg'

🧪 15. Test badge

Tests

- name: Test badge
  uses: ernanej/badge-generator@main
  with:
    name: '100%'
    prefix: 'tests'
    color: 'success'
    path: 'badges/tests.svg'

📈 16. Code coverage badge

Coverage

- name: Code coverage badge
  uses: ernanej/badge-generator@main
  with:
    name: '85%'
    prefix: 'coverage'
    color: 'yellowgreen'
    path: 'badges/coverage.svg'

📉 17. Performance badge

Performance

- name: Performance badge
  uses: ernanej/badge-generator@main
  with:
    name: '96%'
    prefix: 'performance'
    color: 'success'
    path: 'badges/performance.svg'

💬 18. Documentation status badge

Docs

- name: Documentation badge
  uses: ernanej/badge-generator@main
  with:
    name: 'complete'
    prefix: 'docs'
    color: 'blue'
    path: 'badges/docs-complete.svg'

🎯 19. Status badge with emoji (encoded)

Status

- name: Emoji badge
  uses: ernanej/badge-generator@main
  with:
    name: '🚀 ready'
    prefix: 'status'
    color: 'brightgreen'
    path: 'badges/emoji-status.svg'

🛡️ 20. Security status badge

Security

- name: Security badge
  uses: ernanej/badge-generator@main
  with:
    name: 'verified'
    prefix: 'security'
    color: 'success'
    path: 'badges/security.svg'