I'm trying to create a GH Actions job, which will download two submodules from private repositories. I want them to be downloaded with SSH keys which I have already generated.
I've been trying to it as so:
- uses: actions/checkout@v2
with:
submodules: repo_1
ssh-key: ${{ secrets.REPO_1 }}
- uses: actions/checkout@v2
with:
submodules: repo_2
ssh-key: ${{ secrets.REPO_2 }}
This code will create the folders of repo_1 and repo_2, but will be empty.
I have not found a possible solution. Does anyone know how to download multiple private submodules with separate SSH keys?
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_PAT }}
submodules: recursive
You will need to create an encrypted secret called GH_PAT to store the personal access token. This token will need (at minimum) read-only access to the "Contents" category of the main repository and of all the submodules.
I tested this with the v3 of the Checkout action, but I think it will work with v2 as well.
Relevant documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With