-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Cron workflow failing: 401 Bad credentials for GH_ACCESS_TOKEN during make generate (populate.py)
Summary
The scheduled workflow Cron is currently failing during the data population step (make generate), preventing the repository data/site from being updated.
Where it fails
Workflow: .github/workflows/cron.yml
Step: Populate the latest data
Command: make generate → poetry run python gfi/populate.py
The failure happens when the script calls GitHub API to fetch repository info.
Error (from GitHub Actions logs)
The run fails with:
github3.exceptions.AuthenticationFailed: 401 Bad credentials- followed by:
make: *** [Makefile:11: generate] Error 1
Traceback points to gfi/populate.py inside get_repository_info() when calling:
repository = client.repository(owner, name)
Root cause
This looks like an authentication problem, not a code logic issue:
- The workflow relies on a repository secret:
GH_ACCESS_TOKEN - The GitHub API returns 401 Bad credentials, which strongly indicates the secret token is missing/expired/revoked or has insufficient permissions.
Because secrets are repository-owned, this fix requires a maintainer to update the secret.
What I changed (small workflow reliability improvement)
To make failures explicit (avoid false-success runs), I changed the workflow step from:
- name: Populate the latest data
run: make generate
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
to:
- name: Populate the latest data
run: |
set -e
make generate
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
This does not change the logic/output—only ensures the job stops immediately when make generate fails.
Suggested maintainer fix
Regenerate/validate a GitHub token and update the repository secret GH_ACCESS_TOKEN
Ensure the token can access public GitHub API endpoints used by the script (and is not expired/revoked)
Re-run the workflow manually (Actions → Cron → Run workflow) to confirm updates are being generated again
**Notes**
My local clone shows Makefile is correct (generate: poetry run python gfi/populate.py) and the failure is consistently an authentication error (401).