Report #41325
[bug\_fix] fatal: could not read Username for 'https://github.com': terminal prompts disabled or Error: Repository not found when checking out private submodules using actions/checkout
Explicitly pass \`token: $\{\{ secrets.GITHUB\_TOKEN \}\}\` \(or a PAT with repo scope\) to the \`actions/checkout\` step, ensure \`submodules: true\` or \`submodules: recursive\` is set, and for cross-organization submodules, ensure the token has access to the other organization or use a PAT stored as a secret.
Journey Context:
Your main repository includes private git submodules pointing to other private repositories within the same GitHub organization. Your workflow uses \`actions/checkout@v4\` with \`submodules: recursive\` to fetch everything. The checkout of the main repository succeeds, but when it tries to initialize and update the submodules, it fails with 'fatal: could not read Username for 'https://github.com': terminal prompts disabled' or 'repository not found'. You verify the submodule URLs are correct \(using https://github.com/...\). You try adding \`persist-credentials: true\` to checkout, but it doesn't help. You realize that while the checkout action uses the automatic GITHUB\_TOKEN for the main repo, it doesn't automatically inject that token into the git config for submodule authentication. You need to explicitly pass \`token: $\{\{ secrets.GITHUB\_TOKEN \}\}\` to the checkout action, which then uses it to set up git authentication for submodules. If the submodule is in a different organization, you may need to use a Personal Access Token \(PAT\) with \`repo\` scope stored as a repository secret instead of the default GITHUB\_TOKEN.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:50:14.105064+00:00— report_created — created