From 62f45c8c95f0b44d9fe4c402beb0813415f233e1 Mon Sep 17 00:00:00 2001 From: maziggy Date: Mon, 29 Jun 2026 13:28:43 +0200 Subject: [PATCH] ci(repo-stats): clone the github-repo-stats data branch, not gh-pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/repo-stats.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/repo-stats.yml b/.github/workflows/repo-stats.yml index 2c7b2f420..53dca9db9 100644 --- a/.github/workflows/repo-stats.yml +++ b/.github/workflows/repo-stats.yml @@ -29,32 +29,32 @@ jobs: with: path: source - # actions/checkout@v4 was hiding the underlying git stderr behind - # an opaque "exit code 1" even with the same PAT jgehrcke writes - # gh-pages with. Direct git clone surfaces the real error if - # anything goes wrong and avoids the wildcard-refspec dance - # actions/checkout does for fetch-depth=1. - - name: checkout-gh-pages + # jgehrcke/github-repo-stats commits to the `github-repo-stats` + # branch by default (NOT gh-pages — Pages is configured to serve + # from that branch). Direct git clone with the PAT surfaces real + # git stderr if anything fails, unlike actions/checkout@v4 which + # swallows errors as opaque "exit code 1". + - name: checkout-data-branch env: GH_PAT: ${{ secrets.GHRS_GITHUB_API_TOKEN }} run: | - git clone --branch gh-pages --depth 1 \ + git clone --branch github-repo-stats --depth 1 \ "https://x-access-token:${GH_PAT}@github.com/${{ github.repository }}.git" \ - gh-pages - cd gh-pages + data + cd data git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - 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 \ + --report data/maziggy/bambuddy/latest-report/report.html \ + --csv data/maziggy/bambuddy/ghcr-pulls.csv \ --owner maziggy \ --pkg bambuddy - name: commit-and-push - working-directory: gh-pages + working-directory: data run: | if [ -z "$(git status --porcelain)" ]; then echo "no changes — skipping commit"