Netlify and Hugo Modules with private repo (fatal: could not read Username for ''

I have 2 private repos: 1 for my theme and 1 for my site. I’m calling the theme like this:


If is a public repo then I can deploy without any issues (on Netlify), but if it’s a private repo then the build fails because it cannot read username (have already given Netlify access to both repos).

I’d really appreciate help finding a solution to this… I would also be happy to deploy as Cloudflare Worker Pages if somebody knows how to do that with 2 private repos (hugo site + hugo theme module).

I’ve tried using git submodules in the past and it was a disaster, so I’d like to avoid it if possible… especially because I don’t plan to make site-specific changes to the theme repo.