-
Notifications
You must be signed in to change notification settings - Fork 277
33 lines (31 loc) · 1.04 KB
/
language-badge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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