Actions/checkout@v3 with submodules failing, "permission denied"

Has anyone had luck using actions/checkout@v3 (or @v4) in a repository with private repo submodules? It seems like the token is only valid for the repo that’s running the action, not the submodules.

Submodule 'tools' (https://git.example.com/annika/repo.git) registered for path 'tools'
Cloning into '/workspace/annika/repo/subrepo'...
remote: User permission denied
fatal: unable to access 'https://git.example.com/annika/subrepo.git/': The requested URL returned error: 403
fatal: clone of 'https://git.example.com/annika/subrepo.git' into submodule path '/workspace/annika/repo/subrepo' failed
1 Like