docs: replace shields.io endpoint badges with github/ direct badges
- Switch stars/forks/release to github/ endpoints to avoid pool exhaustion - Add CI workflow badge for tests.yml - Delete update-badges.yml (no longer needed) - Remove remote gh-pages branch
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
name: Update Badges
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Fetch repo stats
|
||||
id: api
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
mkdir -p badges
|
||||
|
||||
REPO=$(gh repo view --json stargazerCount,forkCount,latestRelease --jq '.')
|
||||
|
||||
STARS=$(echo "$REPO" | jq -r '.stargazerCount')
|
||||
FORKS=$(echo "$REPO" | jq -r '.forkCount')
|
||||
RELEASE=$(echo "$REPO" | jq -r '.latestRelease.tagName // "N/A"')
|
||||
|
||||
echo '{"schemaVersion":1,"label":"release","message":"'"$RELEASE"'","color":"76bad9"}' > badges/release.json
|
||||
echo '{"schemaVersion":1,"label":"stars","message":"'"$STARS"'","color":"76bad9"}' > badges/stars.json
|
||||
echo '{"schemaVersion":1,"label":"forks","message":"'"$FORKS"'","color":"76bad9"}' > badges/forks.json
|
||||
|
||||
- name: Deploy to gh-pages
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: badges
|
||||
destination_dir: badges
|
||||
commit_message: "Sync badges"
|
||||
user_name: "github-actions[bot]"
|
||||
user_email: "github-actions[bot]@users.noreply.github.com"
|
||||
Reference in New Issue
Block a user