Commit Graph
15 Commits
Author SHA1 Message Date
maziggy 2d8b0005cb Housekeeping 2026-07-07 11:11:15 +02:00
maziggy a48afbb6e7 ci(repo-stats): chart container pulls from ghcr.io alongside clones/stars
GHCR exposes total + 30-day daily-pull counts only in the package page
    HTML (no REST or GraphQL endpoint). jgehrcke/github-repo-stats has no
    notion of container metrics, so post-process the report after it runs.

    New: .github/scripts/ghcr_inject.py
    - Scrapes Total downloads (exact integer from title="N", not the K-rounded
      display) and the 30-day sparkline (rect data-merge-count, data-date).
    - Merges per-day rows into maziggy/bambuddy/ghcr-pulls.csv on gh-pages.
      Fresh window overwrites overlapping dates, so GitHub's late revisions
      to the last 30 days self-correct; days older than 30 stay frozen at
      whatever was captured while still in-window.
    - Patches latest-report/report.html: adds a TOC entry, a Container
      pulls (ghcr.io) section at the top, and a Vega-Lite line+point chart
      whose theme/config is cloned from the existing Total clones chart so
      it inherits the report's look-and-feel.
    - Bracketed by HTML-comment markers so re-runs replace rather than
      stack (jgehrcke regenerates report.html every tick; we re-inject).
    - Hard-fails if either scrape pattern stops matching — silent fallbacks
      would let the chart freeze without notice.

    Workflow: after run-ghrs, checkout source + gh-pages, run the injector,
    commit only if the diff is non-empty. Uses the existing contents: write
    permission; no new secrets.
2026-07-07 10:54:53 +02:00
maziggy 62f45c8c95 ci(repo-stats): clone the github-repo-stats data branch, not gh-pages
The opaque "exit code 1" from actions/checkout was actually masking a
"Remote branch gh-pages not found in upstream origin" — the bambuddy
repo doesn't have a gh-pages branch. jgehrcke/github-repo-stats writes
to a branch called `github-repo-stats` by default, and Pages is wired
to serve from that branch. The path under it (maziggy/bambuddy/latest-
report/report.html) is unchanged.

Switching the clone branch and renaming the local path from `gh-pages/`
to `data/` so the workflow reads correctly. The PAT-in-URL pattern and
the direct git clone (vs actions/checkout) stay — both still wanted so
the real git stderr reaches the log if anything goes wrong.

Verified by cloning `github-repo-stats` locally and running the
injector against its live report.html: clean patch, 30 days extracted,
all anchor markers (TOC, section, script) present.
2026-06-29 13:29:00 +02:00
maziggy e092c1ea6e ci(repo-stats): swap actions/checkout for direct git clone on gh-pages
The PAT-token swap didn't fix the gh-pages fetch — same opaque "exit
code 1" from actions/checkout@v4 on both attempts of the retry loop,
with no underlying git stderr surfaced. Likely the wildcard-refspec
+ shallow fetch pattern v4 uses combined with something at the runner
side, but the action's swallowed errors make it untriagable from logs.

Replacing the gh-pages checkout with `git clone --branch gh-pages
--depth 1` using the same PAT, embedded in the URL. Direct, explicit,
and if anything goes wrong the real git error reaches the log instead
of "exit code 1". The recorded remote keeps the PAT, so the later
`git push` reuses it — no separate auth setup needed.

Identity config (user.name / user.email) moved into the clone step so
it lives on the freshly cloned repo; dropped the now-duplicate config
calls from commit-and-push.

Source checkout still uses actions/checkout@v4 since it never had a
problem (the default ref is the workflow's own commit, no wildcard
refspec required).
2026-06-29 13:25:23 +02:00
maziggy 9bb402b3bf ci(repo-stats): use jgehrcke's PAT for gh-pages checkout
The default GITHUB_TOKEN failed at `git fetch` for the gh-pages
checkout step with opaque "exit code 1" and no surfaced git stderr,
even with permissions: contents: write set at workflow level.
actions/checkout's retry loop didn't recover.

Switching the gh-pages checkout to secrets.GHRS_GITHUB_API_TOKEN —
the same PAT jgehrcke/github-repo-stats already writes the branch
with one step earlier — keeps the auth chain uniform and avoids the
mismatch. persist-credentials defaults to true, so the subsequent
commit-and-push step in the same gh-pages directory picks up the
PAT automatically; no separate change to the push step needed.

fetch-depth: 1 left explicit because checkout@v4 defaults to it but
the value's load-bearing for this workflow (we only need HEAD of
gh-pages, not history).
2026-06-29 13:21:32 +02:00
maziggy 00534679ae ci(repo-stats): chart container pulls from ghcr.io alongside clones/stars
GHCR exposes total + 30-day daily-pull counts only in the package page
HTML (no REST or GraphQL endpoint). jgehrcke/github-repo-stats has no
notion of container metrics, so post-process the report after it runs.

New: .github/scripts/ghcr_inject.py
- Scrapes Total downloads (exact integer from title="N", not the K-rounded
  display) and the 30-day sparkline (rect data-merge-count, data-date).
- Merges per-day rows into maziggy/bambuddy/ghcr-pulls.csv on gh-pages.
  Fresh window overwrites overlapping dates, so GitHub's late revisions
  to the last 30 days self-correct; days older than 30 stay frozen at
  whatever was captured while still in-window.
- Patches latest-report/report.html: adds a TOC entry, a Container
  pulls (ghcr.io) section at the top, and a Vega-Lite line+point chart
  whose theme/config is cloned from the existing Total clones chart so
  it inherits the report's look-and-feel.
- Bracketed by HTML-comment markers so re-runs replace rather than
  stack (jgehrcke regenerates report.html every tick; we re-inject).
- Hard-fails if either scrape pattern stops matching — silent fallbacks
  would let the chart freeze without notice.

Workflow: after run-ghrs, checkout source + gh-pages, run the injector,
commit only if the diff is non-empty. Uses the existing contents: write
permission; no new secrets.
2026-06-29 13:15:41 +02:00
maziggy a5bb8a61a1 ci(repo-stats): chart container pulls from ghcr.io alongside clones/stars
GHCR exposes total + 30-day daily-pull counts only in the package page
HTML (no REST or GraphQL endpoint). jgehrcke/github-repo-stats has no
notion of container metrics, so post-process the report after it runs.

New: .github/scripts/ghcr_inject.py
- Scrapes Total downloads (exact integer from title="N", not the K-rounded
  display) and the 30-day sparkline (rect data-merge-count, data-date).
- Merges per-day rows into maziggy/bambuddy/ghcr-pulls.csv on gh-pages.
  Fresh window overwrites overlapping dates, so GitHub's late revisions
  to the last 30 days self-correct; days older than 30 stay frozen at
  whatever was captured while still in-window.
- Patches latest-report/report.html: adds a TOC entry, a Container
  pulls (ghcr.io) section at the top, and a Vega-Lite line+point chart
  whose theme/config is cloned from the existing Total clones chart so
  it inherits the report's look-and-feel.
- Bracketed by HTML-comment markers so re-runs replace rather than
  stack (jgehrcke regenerates report.html every tick; we re-inject).
- Hard-fails if either scrape pattern stops matching — silent fallbacks
  would let the chart freeze without notice.

Workflow: after run-ghrs, checkout source + gh-pages, run the injector,
commit only if the diff is non-empty. Uses the existing contents: write
permission; no new secrets.
2026-06-29 13:15:07 +02:00
maziggy 2bb65e2d5c Updated CI 2026-04-07 17:17:05 +02:00
maziggy d29688000f Updated CI 2026-04-07 17:16:48 +02:00
maziggy 65a43f0b62 Added stats CI 2026-04-07 16:19:58 +02:00
maziggy 0b0ab23052 Added stats CI 2026-04-07 16:19:42 +02:00
maziggy a63c774065 Added stats CI 2026-04-07 16:11:59 +02:00
maziggy 240b6cb408 Added stats CI 2026-04-07 16:11:43 +02:00
maziggy b5b2064d57 Added stats CI 2026-04-07 16:09:21 +02:00
maziggy fd140e3c64 Added stats CI 2026-04-07 16:08:54 +02:00