A CI job reaches a second private repository
CommonGitHub's GITHUB_TOKEN only has permissions on the repository that contains the workflow. Cloning another private repository, a private submodule or a private Go or npm dependency over https needs a credential that can see it.
Confirm
grep -rn 'github.com/' .gitmodules go.mod package.json 2>/dev/null
An https://github.com/ URL for a repository other than the workflow's own
Fix
- Check out the other repository with its own token, as the actions/checkout README shows: a second checkout step with repository: org/name and token: ${{ secrets.GH_PAT }}, where the secret holds a token with read access to it.
- Prefer a fine-grained token or a GitHub App token limited to the repositories the job needs, over a personal token with access to everything.