Automatically update version health badges in your README via pull request.
name: Update Badges
on:
schedule:
- cron: '0 6 * * 1' # Weekly on Monday
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
badges:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: releaserun/badges@v1
with:
products: |
python:3.12
node:20
postgres:16
badge-types: health,eol
github-token: ${{ secrets.GITHUB_TOKEN }}| Input | Description | Default |
|---|---|---|
products |
Multiline list of product:version pairs |
required |
badge-types |
Comma-separated: health, eol, freshness, cve, cloud |
health |
readme-path |
Path to README file | README.md |
style |
Badge style (flat, flat-square, plastic, for-the-badge) |
flat |
link-to |
Where badges link: badge-page, releaserun, none |
badge-page |
pr-title |
Title for the created PR | chore: update version health badges |
pr-branch |
Branch name for the PR | releaserun/badges-update |
github-token |
GitHub token for creating PRs | GITHUB_TOKEN env |
badge-service-url |
Base URL for badge service (for testing/custom deployments) | https://img.releaserun.com |
| Output | Description |
|---|---|
pr-number |
Number of the created/updated PR |
pr-url |
URL of the created/updated PR |
badges-markdown |
The generated badge markdown |
badges-count |
Number of badges generated |
pr-branch |
The branch name used for the PR |
Add these markers to your README where you want badges to appear:
<!-- releaserun-badges-start -->
<!-- releaserun-badges-end -->The action replaces everything between the markers with generated badges. If markers are not found, the action logs a warning and skips.
- uses: releaserun/badges@v1
with:
products: |
python:3.12
node:20- uses: releaserun/badges@v1
with:
products: |
python:3.12
node:20
postgres:16
badge-types: health,eol,cve
style: for-the-badge- uses: releaserun/badges@v1
with:
products: |
python
nodeImportant: The
dist/directory must be committed to the repository and kept in sync with the source code. After making changes tosrc/, always runnpm run build && npm run packageand commit the updateddist/directory. GitHub Actions loads the action directly fromdist/index.js.
For python:3.12 with badge types health,eol:
[](https://releaserun.com/badges/python/) [](https://releaserun.com/badges/python/)