CI cannot clone a private submodule: authentication fails in `actions/checkout`.
IntermediateScenarioScale, Submodules, LFS and GitHub Automation
Answer
Situation read → GITHUB_TOKEN is scoped to the current repository only.
What I'd do →
- Use a deploy key, GitHub App token or fine-grained PAT with read access to the submodule repo.
- In the workflow:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_READ_TOKEN }}
- If
.gitmodulesuses SSH URLs, passssh-keyinstead. - Keep the token read-only and rotate it.
Why → The default token cannot see other private repositories.
Interview tip → Using HTTPS URLs in .gitmodules makes CI auth simpler.
More on Scale, Submodules, LFS and GitHub Automation
A monorepo has 4 GB of history and developers only touch one service. How do you make their day-to-day faster?IntermediateDesigners commit PSD and video assets, and the repo keeps growing. How do you move them to Git LFS?IntermediateYour GitHub LFS bandwidth quota is exhausted and CI pulls fail. What do you do?AdvancedA repository uses a submodule. How does a developer get the right version of it?BeginnerSubmodules, subtree or a package manager for sharing code between repos?IntermediateYou must remove a submodule completely.Beginner