When collectExternalReferences() is run with an invalid GITHUB_API_TOKEN, public GitHub Pages content still loads successfully, but the GitHub API branch lookup fails with 401, producing misleading errors like “Could not get commit hash from main branch”.
Expected:
- If the repo is public, retry the branch lookup without auth after a 401, or
- downgrade this to a warning that the token is invalid/stale, since term collection can still succeed.
Also, the warning text references GITHUB_PAT, while the code reads GITHUB_API_TOKEN.
When
collectExternalReferences()is run with an invalidGITHUB_API_TOKEN, public GitHub Pages content still loads successfully, but the GitHub API branch lookup fails with401, producing misleading errors like “Could not get commit hash from main branch”.Expected:
Also, the warning text references
GITHUB_PAT, while the code readsGITHUB_API_TOKEN.