Interview Prep/Git & GitHub/Scale, Submodules, LFS and GitHub Automation

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 →

  1. Use a deploy key, GitHub App token or fine-grained PAT with read access to the submodule repo.
  2. In the workflow:
- uses: actions/checkout@v4
  with:
    submodules: recursive
    token: ${{ secrets.SUBMODULE_READ_TOKEN }}
  1. If .gitmodules uses SSH URLs, pass ssh-key instead.
  2. 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.

All Git & GitHub questions Roadmap: Git & GitHub

More on Scale, Submodules, LFS and GitHub Automation