如何在Github中下载私人远程软件包(错误:“无法读取用户名”)[重复]

I'm trying to access a Go private remote package on my firm's Github inside a CircleCI's job. I've managed to get it in the test job, with:

git config --global url."https://{user}:${token}@github.com/".insteadOf "https://github.com/"

But somehow, this command doesn't work in the build job. I have this error at the Build app Docker image step, when "RUN go mod download" is launched :

fatal: could not read Username for 'https://github.com': terminal prompts disabled

I've read a lot about it, like this issue or this Medium, I've also tried to change export git_terminal_prompt=1 but nothing works.

Any idea ? Many thanks !

</div>