chore: add GHCR downloads badge and update workflow for automated fetching

This commit is contained in:
GitHub Actions
2026-02-10 23:07:46 +00:00
parent 9b2d8e5455
commit 413f9609a1
4 changed files with 169 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
name: "Badge: GHCR downloads"
on:
schedule:
# Update periodically (GitHub schedules may be delayed)
- cron: '17 * * * *'
workflow_dispatch: {}
permissions:
contents: write
packages: read
concurrency:
group: ghcr-downloads-badge
cancel-in-progress: false
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout (main)
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: main
- name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: 20
- name: Update GHCR downloads badge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GHCR_OWNER: ${{ github.repository_owner }}
GHCR_PACKAGE: charon
BADGE_OUTPUT: .github/badges/ghcr-downloads.json
run: node scripts/update-ghcr-downloads-badge.mjs
- name: Commit and push (if changed)
shell: bash
run: |
set -euo pipefail
if git diff --quiet; then
echo "No changes."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .github/badges/ghcr-downloads.json
git commit -m "chore(badges): update GHCR downloads [skip ci]"
git push origin HEAD:main