Deploy key needed for private submodules

Hi, I need a deploy key for the site “doganbone” please as it houses private submodules.

I was directed to request via this help topic: [Common Issue] How do I access private repositories in the build environment?

Thanks :pray:

Sure thing, here you go. This is ok to share publicly since it only allows our system to read from the repo(s) with it enabled - does not give anyone else permission to read your repo or otherwise do anything dastardly :slight_smile:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCVap0uoIp620D/V1p5Cd9N6a2jFt/eR+3yjUcPLZkjVIXwnDg4gOMSvi6I6HX+JOZr/LLeTehr7IchBw+m5up+fPCZVgPrBLbVmH6XI/FErfHmhUdyhCBUTW83Vw8ys7sW/OQjtuue4Z4fGkVs2GEr0y4F15/FVl6JEONXhhxXuh8Osyli+ewvNSTKIpLDGEMkzmKTL6kZdMR4JTEQ6kCG3MdMq8z1qvVqKTP1N6Zs9OmnoGt58YReGAlt4o2J1hDuLB8mtJ5uIu8C1NgGt48KkXyEPwfltHDAbe4U/Kn8S0a+W1fihnLw2LhpVG0yV10J2VvfBrRDD7e/E1VIH3IQVaTzcRow8aCFBj154jtSkAeVw/EXuaT5FGdbDom30uGE8vgbhdWiTs0hiPAIY4y7LUoVB1+EgwHFN/Bsjaflv0xDcgiFyoyyyVkrbSfIO/dQq7sIKGomk/Rir4puIEHv2xsQgUI6XED7L/8LW9YA3ZEXWhsQPwCCxsbgfA+Z/5GQ0vGRKS5koacNvBC0LsPlDwBPdw6N9HFHUX32yK1C4KAvfRqqO1ocMRZmLb00qsLL3zzaChfoDePvoxqpPcdTUdztwT2Ft8VpBBLRbi25wfuXvlv8iwUz4qO3r7Ycbfr5wv7FJvtiqHSnFkpM0zm1QI253wziuETpDDKXtm3H+w==

Amazing thanks @fool!!

Hey @fool ,

I’ve added the key to the private modules deploy keys, but I still keep getting the following error when trying to deploy changes:

Error checking out submodules: Submodule

It’s correct what I’m doing the key should be under deploy keys for the private modules repo?

Appreciate the helps!

Hi, @mykz.

To grant permissions for our build system to access your private submodule, you’ll need to do the following:

  1. Assign the deploy key as a read-only deploy key in your repository settings at GitHub (https://github.com/account/project/settings/keys). See below for this key. NOTE: It will only work on this site; we have to generate separate ones for other sites, so please let me know if you need to enable that workflow elsewhere too.

  2. Once it’s in place, when we check out the first repo to build, we’ll fetch the submodule with this deploy key and this will work!

  3. You can use this workflow with multiple private submodules attached to the same repository, but that does take some extra work since GitHub does not allow Deploy Keys to be used in multiple places. You’ll have to instead add them to a user (perhaps you? or maybe a robot-account that you create on GitHub) that has access to all repos.

​Please let us know if there are other questions about this.

Hey Luke,

Thanks for getting back to me!

I’ve adding the deploy key to the sites repo and I’m met with a new error when trying to trigger a new deploy:

8:51:19 AM: Error fetching branch: https://x-access-token:v1.<token>@github.com/mykz/doganbone.com refs/heads/master

8:51:19 AM: Failing build: Failed to prepare repo

8:51:19 AM: failed during stage 'preparing repo': exit status 1

I took out the token in the example error and replaced it with as I’m not sure if that should be public.

Appreciate the help

I seem to have found another forum post on the error here:

https://community.netlify.com/t/error-fetching-branch-after-trying-to-update-submodule/5370

I’ve tried doing the “clear cache and deploy” but then I’m greeted with the previous error:

Error checking out submodules: Submodule 'themes/brvthers' (https://github.com/mykz/brvthers-hugo.git) registered for path 'themes/brvthers'

I’m not sure whats going on as I have the deploy key setup under keys on the repo.

@luke @fool Any ideas?

I’ve also tried adding the ssh key to my account that is the owner of both repo’s and still I’m presented with the same error.

I have the same problem with 2 sites now.

“doganbone” & “kaffeGrums”

I’ve tried everything suggested in comments from @luke and also in the forum posts. I’ve listed what I’ve tried below:

  • Added key to my account
  • Added key to main repo deploy keys
  • added to private module repo deploy keys

I’d really like to get this working because I’m unable to currently deploy any sites on the account.

@luke @fool

Should be a quick fix:

5:04:34 AM: Error checking out submodules: Submodule 'themes/brvthers' (https://github.com/mykz/brvthers-hugo.git) registered for path 'themes/brvthers'

means that you are using the https URI for your git repo, which won’t use that deploy key at all. Please use the ssh one instead, it’ll look like:

git@github.com:account/projectname

@fool Perfect this worked like a charm!

Hi there! Just dropping by to mention that we have now shipped a UI update that allows you to generate a deploy key in the UI and no longer have to get in touch with support to do so :tada:

more here: