@@ -38,13 +38,11 @@ ENV CXX=o64-clang++
3838ARG TARGETOS
3939FROM ${TARGETOS}-base AS lint
4040ENV CGO_ENABLED=1
41- ENV GOPRIVATE=github.com/docker/*
4241COPY --link --from=lint-base /usr/bin/golangci-lint /usr/bin/golangci-lint
4342RUN apk add --no-cache openssh-client
4443WORKDIR /app
4544RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
4645RUN --mount=type=bind,target=.,ro \
47- --mount=type=secret,id=GH_TOKEN,env=GH_TOKEN \
4846 --mount=type=cache,target=/go/pkg/mod \
4947 --mount=type=ssh <<EOT
5048 set -euo pipefail
@@ -55,16 +53,6 @@ RUN --mount=type=bind,target=.,ro \
5553 # If no token, prefer SSH for GitHub; if token exists, we’ll override below
5654 git config --global url."ssh://git@github.com/" .insteadOf "https://github.com/"
5755
58- # fallback for CI environments without ssh keys
59- if [ -n "$GH_TOKEN" ]; then
60- rm -f ~/.gitconfig
61- git config --global user.email "106345742+cloud-platform-ci[bot]@users.noreply.github.com"
62- git config --global user.name "cloud-platform-ci[bot]"
63- git config --global url."https://x-access-token:${GH_TOKEN}@github.com" .insteadOf "https://github.com"
64- git config --global --add url."https://x-access-token:${GH_TOKEN}@github.com" .insteadOf "ssh://git@github.com"
65- git config --global --add url."https://x-access-token:${GH_TOKEN}@github.com/" .insteadOf "git@github.com:"
66- fi
67-
6856 for dir in $(go list -f '{{.Dir}}' -m); do
6957 (cd "$dir" && go mod tidy --diff)
7058 done
0 commit comments