Getting error while doing git clone submodule

I have a repo which has 2 git submodules, when trying to deploy it from the Cloudflare pages it is unable to clone those submodules and giving error like “fatal: could not read Username for ‘https://github.com/’: Input/output error” but both those repo are under the same org from which i am cloning from i.e i am deploying the repo company/A and the other repos are company/B and company/C , Cloudflare is able clone the deployment product i.e A but not able to clone B and C . When i gave my access token in submodule path for B and C then it was able to clone it out and deployment worked, but i dont want to put the token in .gitmodules due to security concerns. Any idea on how to fix this and maybe add the security token to the environment variables of Cloudflare pages

1 Like

hey did you find a solution for this?

I am also having the same use case and same issue.

I was able to store an environment variable on Cloudflare pages, but there was little documentation on how to use it. I wonder if you have successfully find a solution?

I had the same problem and it was solved.

  1. Give Cloudflare permission to access the GitHub repository you want to use as a submodule.
  2. Change the submodule to clone via SSH instead of HTTPS.

I referred to this page and it works correctly.

2 Likes

I almost gave up, but in the end I found the error in my case:
I had to prefix the build command with the command to clone the submodules.
CleanShot 2024-05-05 at 15.00.48

The submodules were then checked out as expected and the page could be built.

=> It would be helpful if this were available as an option. To be honest, this was just an attempt out of desperation; I didn’t think the field would accept two commands at once…
I hope this helps someone else with the same problem…

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.