Go mod download private git registry. #72
Answered
by
crazy-max
lichunqiang
asked this question in
Q&A
-
My project depends on a private Git registry. When using Goxx to cross-build, What's the best practice for this scenario? |
Beta Was this translation helpful? Give feedback.
Answered by
crazy-max
May 11, 2024
Replies: 1 comment
-
I don't think this is relevant to goxx but your workflow as you would have the same issue when building with standard golang image but you can do smth similar to docker/build-push-action#1112 (comment) using a secret mount. In your case: RUN --mount=type=secret,id=GIT_AUTH_TOKEN \
set -e
GIT_AUTH_TOKEN=$(cat /run/secrets/GIT_AUTH_TOKEN)
if [ -n "$GIT_AUTH_TOKEN" ]; then
echo "Setting GitHub access token"
git config --global "url.https://x-access-token:${GIT_AUTH_TOKEN}@github.com.insteadof" "https://github.com"
fi
go mod download -x
EOT |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lichunqiang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think this is relevant to goxx but your workflow as you would have the same issue when building with standard golang image but you can do smth similar to docker/build-push-action#1112 (comment) using a secret mount.
In your case: