GitHub Actions "could not read Username" (token not passed to git)
A git command tried to authenticate interactively because no token was configured. In CI there is no prompt, so it fails. This is a setup issue, not transient.
What this error means
A git fetch, clone, or push fails with "could not read Username for https://github.com: terminal prompts disabled".
github-actions
fatal: could not read Username for 'https://github.com': terminal prompts disabledCommon causes
No credentials configured
Cloning a private repo or pushing without a token means git has no way to authenticate.
Manual git after checkout cleared credentials
Re-cloning a different repo, or disabling persist-credentials, removes the auth header.
How to fix it
Supply a token to git
- Pass a token to actions/checkout, or set an extraheader with a PAT.
- For private submodules or other repos, configure the URL with the token.
.github/workflows/ci.yml
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}How to prevent it
- Always provide a token when accessing private repositories.
- Avoid disabling persist-credentials unless you re-add auth yourself.
Related guides
GitHub Actions "Input required and not supplied: token"Fix the GitHub Actions error "Input required and not supplied: token" caused by an action that needs a token…
GitHub Actions checkout persisted credentials push 403Fix the GitHub Actions 403 when pushing after actions/checkout, caused by the persisted GITHUB_TOKEN lacking…
GitHub Actions 403 while pushing with GITHUB_TOKENFix the GitHub Actions 403 error when pushing with the GITHUB_TOKEN, caused by a missing contents write scope…