| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- name: GitHub Repo Stats
- on:
- schedule:
- - cron: "0 23 * * *"
- workflow_dispatch:
- permissions:
- contents: write
- jobs:
- repo-stats:
- name: repo-stats
- runs-on: ubuntu-latest
- steps:
- - name: run-ghrs
- uses: jgehrcke/github-repo-stats@v1.4.2
- with:
- repository: maziggy/bambuddy
- ghtoken: ${{ secrets.GHRS_GITHUB_API_TOKEN }}
- ghpagesprefix: https://maziggy.github.io/bambuddy
- # Inject ghcr.io container-download stats (cumulative + 30-day
- # sparkline merged into a sidecar CSV so the chart grows beyond
- # the 30-day window GHCR exposes). Runs after jgehrcke regenerates
- # report.html on gh-pages.
- - name: checkout-source
- uses: actions/checkout@v4
- with:
- path: source
- - name: checkout-gh-pages
- uses: actions/checkout@v4
- with:
- ref: gh-pages
- path: gh-pages
- # Same PAT jgehrcke writes gh-pages with — keeps the auth
- # chain uniform and avoids the default GITHUB_TOKEN being
- # rejected on fetch (root cause of the earlier "exit code 1"
- # with no surfaced git stderr).
- token: ${{ secrets.GHRS_GITHUB_API_TOKEN }}
- fetch-depth: 1
- - name: inject-ghcr-pulls
- run: |
- python3 source/.github/scripts/ghcr_inject.py \
- --report gh-pages/maziggy/bambuddy/latest-report/report.html \
- --csv gh-pages/maziggy/bambuddy/ghcr-pulls.csv \
- --owner maziggy \
- --pkg bambuddy
- - name: commit-and-push
- working-directory: gh-pages
- run: |
- if [ -z "$(git status --porcelain)" ]; then
- echo "no changes — skipping commit"
- exit 0
- fi
- git config user.name "github-actions[bot]"
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- git add maziggy/bambuddy/latest-report/report.html \
- maziggy/bambuddy/ghcr-pulls.csv
- git commit -m "ghcr-pulls: refresh container downloads chart"
- git push
|