URLs in `.gitmodules` starting with `ssh://` do not work.
You'll need to use an SSH key instead of a PAT if any URL in your .gitmodules file starts with ssh:// instead of https:// or [email protected]: otherwise GitHub will fail to clone the submodule in question with a Host key verification failed error.
Good afternoon, encountered a similar problem using deploy-key ssh and private submodule
In .gitmodules I specified
[submodule "SubModuleRepo"]
path = SubModuleRepo
url = [email protected]:Org/SubModuleRepo.git
I also tried to specify absolute path but I get the same error
url = ssh://[email protected]:Org/SubModuleRepo.git.
When I try to download the sub module I get the error
[email protected]: Permission denied (publickey).
Error: fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Error: fatal: clone of '[email protected]:Org/SubModuleRepo.git' into submodule path "<<builder_path>>"
In pipeline:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
ssh-key: ${{ secrets.DEPLOY-KEY}}
Could you show in detail your settings and how exactly you solved this problem?
Hi, I also encountered the same problem using deploy-key ssh and private submodule. My solution is to use the https instead of ssh in .gitmodules, and try token in .yml:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
Unfortunately, this step only rewrites [email protected]: URLs, not ssh://github.com/ ones: https://github.com/actions/checkout/blob/ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493/src/git-auth-helper.ts#L67