Skip to content

A GitHub action to display Credly badges in your GitHub profile page!

License

Notifications You must be signed in to change notification settings

mikejoh/credly-badges

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

credly-badges

goreleaser

A GitHub action to display your Credly badges in your personal GitHub profile README!

Inspired by this repo.

Note that this GitHub action only supports fetching badges from Credly.

How-to

  1. Add the following to your github.com/<owner>/<repo>/README.md add the following:
<!--START_BADGES:badges-->
<!--END_BADGES:badges-->
  1. In your repository create a workflows directory:
mkdir -p .github/workflows
  1. Create a file called e.g. credly-badges.yaml with the following contents:
name: "Credly Badges"

on:
  schedule:
    - cron: "0 0 * * *"

jobs:
  credly-badges:
    name: "Update README with Credly badges"
    runs-on: ubuntu-latest

    steps:
      - name: Update
        uses: mikejoh/credly-badges@main
        with:
          CREDLY_USERNAME: <Your Credly username>
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COMMIT_MESSAGE: "Update Credly badges!"

Note that you might want to replace @main and pin to a specific version, see the Releases page for available released versions.

If you want to try it out, without waiting for the trigger to be scheduled, you can add another trigger e.g.:

...
on:
  push:
...

And push a commit to your profile repository, in the Actions tab of your repository you shall now see that it has triggered.

Test locally

  1. Build:
go build -o credly-badges .
  1. Create a GitHub token.
  2. Run:
export INPUT_GITHUB_TOKEN="token"
./credly-badges -credly-username <username> -gh-username <GitHub username> -gh-token $INPUT_GITHUB_TOKEN

About

A GitHub action to display Credly badges in your GitHub profile page!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages