Readme Credly Badges
A GitHub Action that automatically updates your README.md
(or any markdown file) with your Credly badge details, no manual edits required!
Usage
- In the repository, create a
.github/workflows/
directory. - Add
update-badges.yaml
file with the following content:
yaml
name: Update Credly Badges
on:
schedule:
- cron: '0 0 * * *' # Runs daily at 00:00 UTC
workflow_dispatch: # Optional: allows manual trigger
permissions:
contents: write # Required if using the default GITHUB_TOKEN
jobs:
update-readme:
name: Update README with Credly Badges
runs-on: ubuntu-latest
steps:
- name: Update Badges in README
uses: jd-35656/readme-credly-badges@v1
with:
credly_username: 'your-credly-username'
github_token: ${{ secrets.GITHUB_TOKEN }}
- In your repository, create or edit the
README.md
file to include:
markdown
## Credly Badges
<!-- START CREDLY BADGES -->
<!-- END CREDLY BADGES -->
Parameters
Click to show/close parameters
Name | Type | Required | Default | Description | More Description |
---|---|---|---|---|---|
credly_username | string | {github.actor} | Your Credly username | ||
badge_size | string | 150x150 | Badge image size (e.g., 150x150, 680x680) | ||
badge_sort_by | string | issued | Sort order. | Optional values: issued updated accepted . | |
github_api_url | string | https://api.github.com | GitHub API URL (for GitHub Enterprise use). | ||
github_token | string | true | {github.token} | Token with write access to the repository. | |
github_repo | string | {github.repository} | Target GitHub repository. | ||
github_branch | string | main | Branch where the target file is located. | ||
readme_file | string | README.md | Path to the markdown file to update. | ||
commit_message | string | Updated README with new badges | Custom commit message. |
Examples
markdown
### Credly Badges
<!-- START CREDLY BADGES -->
[](https://www.credly.com/badges/9818630e-28f4-4541-964c-e79041c4d601)
[](https://www.credly.com/badges/d557a8cd-735a-4abe-8f83-0f2e4f514a2c)
[](https://www.credly.com/badges/06bb5e5a-8069-4d4d-9f39-d608dbf84cd3)
[](https://www.credly.com/badges/adfadf9c-8271-43d7-8edb-ae2370fe272d)
[](https://www.credly.com/badges/0def91c4-2a33-47a9-90fb-0cbaaaaca301)
[](https://www.credly.com/badges/8cdd9a26-4452-410d-9d20-b351629dcf75)
[](https://www.credly.com/badges/3ccfe59f-8525-4b35-bacb-d5955486bef4)
<!-- END CREDLY BADGES -->