Protected Git Submodule Heroku

Viewed 114

I am trying to push commits from git to Heroku. My project has a private submodule which is causing the following errors during deployment:

remote: Git submodules detected, installing:
remote: Submodule 'surveyScriptContents' (https://github.com/PurplePineapple123/Post-Purchase-Survey-Script-Tag.git) registered for path 'surveyScriptContents'
remote: Cloning into 'surveyScriptContents'...
remote: fatal: could not read Username for 'https://github.com': No such device or address
remote: fatal: clone of 'https://github.com/PurplePineapple123/Post-Purchase-Survey-Script-Tag.git' into submodule path 'surveyScriptContents' failed
remote: 
remote: !       Push rejected, submodule install failed
remote: 
To https://git.heroku.com/morning-peak-19860.git
 ! [remote rejected] HEAD -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/morning-peak-19860.git'

Reading the Heroku docs it looks like I just need to change the URL in my .gitconfig/.gitmodules file to follow this structure: https://username:password@github.com/myusername/FooBar.

However, Heroku adds this warning: Since submodule references are stored in plaintext in the .git/submodules directory please consider if this is acceptable for your particular security requirements.

I've been looking for ways to properly authenticate the submodule without exposing my password. However, I'm struggling to figure out how to make this work. I've explored using an .env variable but that did not work.

Any idea how properly authenticate a private submodule to allow pushes to Heroku?

0 Answers
Related