question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support private repositories and private submodules

See original GitHub issue

Currently 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:open
  • Created 3 years ago
  • Reactions:126
  • Comments:29

github_iconTop GitHub Comments

38reactions
samuelcolvincommented, Oct 12, 2020

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.

24reactions
KubaOcommented, Aug 20, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found