Skip to content

Releases: muhammadrafayasif/mslearn-badges

Microsoft Learn README badges

10 May 13:27

Choose a tag to compare

🏅 Microsoft Learn Badges GitHub Action

Automatically scrape your Microsoft Learn badges and generate a neat grid that you can use in your GitHub profile README.


✨ Features

  • Scrapes all badges from a given Microsoft Learn username
  • Dynamically updates the README of your profile to include all MS Learn badges
  • Runs daily or on manual dispatch
  • Can be used as a GitHub Action or standalone script

🚀 Usage

Add the following workflow to .github/workflows/daily-badges.yml in your repo:

Note

Replace mslearn-username with your username from Microsoft Learn

name: Daily Microsoft Learn Badges

on:
  schedule:
    - cron: '0 12 * * *'  # runs daily at 12:00 UTC
  workflow_dispatch:       # manual trigger

jobs:
  fetch-badges:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v3

      - name: Fetch Microsoft Learn Badges
        uses: muhammadrafayasif/mslearn-badges@main
        with:
          mslearn-username: "[username]"
          output-path: "badges"
          
      - name: Commit updated badges
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "github-actions[bot]@users.noreply.github.com"
          git add README.md
          git commit -m "chore: update Microsoft Learn badges [skip ci]" || echo "No changes to commit"
          git push
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}