Report #86834
[bug\_fix] fatal: could not read Username for 'https://github.com': terminal prompts disabled on submodule update
Configure \`actions/checkout\` with \`submodules: recursive\` AND \`token: $\{\{ secrets.YOUR\_PAT \}\}\` \(or use \`ssh-key: $\{\{ secrets.SSH\_KEY \}\}\`\). Ensure the PAT has 'repo' scope or the SSH key is added to the submodule repo's deploy keys. Root cause: The default \`GITHUB\_TOKEN\` is scoped only to the workflow's repository and cannot authenticate against private submodules hosted in other repositories \(even within the same organization\). The checkout action requires explicit credentials to authorize git commands against those external URLs.
Journey Context:
A developer's project depends on a shared library stored in a private repository within the same GitHub organization, included as a git submodule. Locally, they use SSH keys and \`git submodule update --init\` works perfectly. They set up a GitHub Actions workflow using \`actions/checkout@v4\` with \`submodules: true\`. The job fails during the 'Checkout submodules' phase with 'fatal: could not read Username for 'https://github.com': terminal prompts disabled'. The developer first suspects that \`persist-credentials: true\` \(the default\) should pass the token, but the error persists. They try manually configuring git with \`git config --global url.'https://x-access-token:$\{\{ secrets.GITHUB\_TOKEN \}\}@github.com/'.insteadOf 'https://github.com/'\`, but this still fails with 403 or the same prompt error because \`GITHUB\_TOKEN\` cannot access other private repos. After reading the \`actions/checkout\` documentation thoroughly, they realize they must create a Personal Access Token \(Classic\) with 'repo' scope, add it as a repository secret \(e.g., \`SUBMODULE\_PAT\`\), and pass it explicitly to the checkout action via \`token: $\{\{ secrets.SUBMODULE\_PAT \}\}\`. This grants the checkout step permission to read the submodule repository, and the clone succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:20:25.805487+00:00— report_created — created