reusable_go_lint_test: Support private repo authentication #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds
go-private-repos-authentication
input togo_lint_test
anddocker_pipeline
workflow to allow Golang repos to use private modules.If the input is enabled, it will change the git config to use PAT when downloading packages.
One important thing to note here: while it's recommended to set
GOPRIVATE
to control which modules the go command considers to be private and should therefore not use the proxy or checksum database (ref), I decided not to add the variable to support it so that the workflow's caller is cleaner. One example of that variable can bewhich can be used as below in the
go_lint_test
To make the above consideration work, the
GOPROXY='https://proxy.golang.org,direct/
env must be set, which is true as it's the default value (e.g You can check thePrint Go environment step
of this workflow run).Also https://docs.docker.com/build/ci/github-actions/secrets was referred to mount secrets to docker which is useful when reviewing
docker_pipeline
.Example of workflow caller PR babylonlabs-io/finality-provider#43