Skip to content

Generate Language Badge #122

Generate Language Badge

Generate Language Badge #122

name: Generate Language Badge
on:
schedule:
# Once week at midnight UTC
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
make-badge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.BADGE_TOKEN }}
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Get Language Count
id: vars
run: echo "::set-output name=language_count::$(cargo run -- --languages | wc -l)"
- name: Get Badge
run: curl https://img.shields.io/badge/languages-${{ steps.vars.outputs.language_count }}-blue > ./assets/language-badge.svg
- name: Commit Badge
continue-on-error: true
run: |
git add ./assets/language-badge.svg
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Update language badge [Skip CI]"
git push