I have added a submodule to a repo, however when I try to init and update the submodule, nothing happens.
There’s no output to the screen and no files appear in the submodule directory.
One slight complication is that the submodule is a private Github repo, however I’ve added a deploy key to the repo with the private key added as an ssh alias. I need to use ssh aliases because the action in which the code runs needs to access multiple private repos a bit later in the workflow.
ssh config contains:
Host github.com-id_rsa_data
Hostname github.com
IdentityFile=/home/runner/.ssh/id_rsa_data
Git .submodule file:
[submodule "_posts_from_sub/"]
path = _posts_from_sub/
url = https://github.com-id_rsa_data/<username-redacted>/test-data
Commands I run in the action step:
git submodule init
git submodule update --init --recursive
I tried adding —progress and —verbose to both commands but those options are not supported for git submodule.
Why doesn’t the test-data submodule get cloned after init and update are run?
Update to ssh config as per VonC:
[submodule "_posts_from_sub/"]
path = _posts_from_sub/
url = git@github.com-id_rsa_data/<username-redacted>/test-data
Also tried:
[submodule "_posts_from_sub/"]
path = _posts_from_sub/
url = git@github.com-id_rsa_data:<username-redacted>/test-data
and
[submodule "_posts_from_sub/"]
path = _posts_from_sub/
url = git+ssh://git@github.com-id_rsa_data:<username-redacted>/test-data