Support private repositories and private submodules
See original GitHub issueCurrently the checkout action doesn’t work with private repositories using a private submodule.
As a work-around we use the following in our workflow.
steps:
- name: clone main repository
uses: actions/checkout@v2
- name: clone submodule
uses: actions/checkout@v2
with:
repository: our-organization/private-repo
path: private-repo
ref: v2
ssh-key: ${{ secrets.SUBMODULE_SSH_KEY }}
persist-credentials: false
It would be good if the checkout action would support some option to provide a different SSH_KEY for private submodules. E.g. SUBMODULE_SSH_KEY
could be an organisation level SSH Key that allows pulling the repos.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:126
- Comments:29
Top Results From Across the Web
Building private GitHub repositories with sub-modules
The problem with private sub-modules. Git has submodules support and this is a wonderful tool for organizing large projects or reusing some code....
Read more >Using Git Submodules for Private Content - Tania Rascia
Submodules are used when a subdirectory in a repo should consist of all the data from another repo. You can add a submodule...
Read more >Using Private Git Submodules - Read the Docs
This guide is for Read the Docs for Business. Read the Docs uses SSH keys (with read only permissions) in order to clone...
Read more >How to git clone a private repo with a private submodule in a ...
How can I clone this other private repository with its containing submodule? I tried - uses: actions/checkout@v3 with: submodules: true.
Read more >Git Submodules with Public and Private Repos - Medium
Our project, Goldstone Server has multiple submodules. Some are in private repos; therefore, are not accessible to developers outside the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @marcofranssen,
this is just want I needed.this is a partial solution.For anyone else looking, deploy keys are a partial fix.
The problem with deploy keys and a separate clone submodules step is that you need to keep the submodule ref and the ref in github actions the same, editing the setting in two places.
Personal access tokens as suggested by @beroso work, but either involve giving access to all your repos, or creating a new machine user and adding them as a collaborator, big faff.
It would be great if github could provide a proper and simple way to clone private submodules.
It’s a travesty really that this doesn’t work out of the box. It forces behaviors that should be discouraged - people fret about submodules (they shouldn’t), people have to pay for dummy GitHub accounts just to make this work, people have to bend backwards to get something that is well within the minimally viable product spec for any CI environment. /smh