Przeglądaj źródła

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).
maziggy 2 miesięcy temu
rodzic
commit
1db695d9fc
1 zmienionych plików z 6 dodań i 0 usunięć
  1. 6 0
      .github/workflows/repo-stats.yml

+ 6 - 0
.github/workflows/repo-stats.yml

@@ -34,6 +34,12 @@ jobs:
         with:
         with:
           ref: gh-pages
           ref: gh-pages
           path: 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
       - name: inject-ghcr-pulls
         run: |
         run: |