From 554b80523d8316b50d97e66ec670f085beeccc1a Mon Sep 17 00:00:00 2001 From: William Bezuidenhout Date: Wed, 2 Oct 2024 15:52:03 +0200 Subject: [PATCH] add required github config (#1113) * add required github config * set no username in git cfg * use different syntax on windows --- .github/workflows/go-ci.yml | 6 ++++++ .github/workflows/go-lint.yml | 2 ++ .github/workflows/goreleaser-check.yml | 2 ++ .github/workflows/goreleaser.yml | 2 ++ .github/workflows/scip.yml | 2 ++ 5 files changed, 14 insertions(+) diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index fafe948376..7c44620926 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -21,6 +21,12 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} + - name: (Windows) Enable pulling Go modules from private sourcegraph/sourcegraph + if: runner.os == 'Windows' + run: git config --global url."https://$env:PRIVATE_TOKEN@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" + - name: (Default) Enable pulling Go modules from private sourcegraph/sourcegraph + if: runner.os != 'Windows' + run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - run: | go test -race -v ./... go test -v ./... diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index c394ce0f97..f15416750a 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -17,4 +17,6 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.22.5 + - name: Enable pulling Go modules from private sourcegraph/sourcegraph + run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - run: ./dev/go-lint.sh diff --git a/.github/workflows/goreleaser-check.yml b/.github/workflows/goreleaser-check.yml index 080a9dc320..d48d84b75a 100644 --- a/.github/workflows/goreleaser-check.yml +++ b/.github/workflows/goreleaser-check.yml @@ -20,6 +20,8 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.22.5 + - name: Enable pulling Go modules from private sourcegraph/sourcegraph + run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - name: Check GoReleaser config uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 75ef436158..1bb3523927 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -182,6 +182,8 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.22.5 + - name: Enable pulling Go modules from private sourcegraph/sourcegraph + run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - run: go test ./... - run: go test -race -v ./... - run: echo "${DOCKER_PASSWORD}" | docker login -u=$DOCKER_USERNAME --password-stdin diff --git a/.github/workflows/scip.yml b/.github/workflows/scip.yml index c7a01d2342..a1969f7f6f 100644 --- a/.github/workflows/scip.yml +++ b/.github/workflows/scip.yml @@ -16,6 +16,8 @@ jobs: chmod +x /usr/local/bin/src - name: Set directory to safe for git run: git config --global --add safe.directory $GITHUB_WORKSPACE + - name: Enable pulling Go modules from private sourcegraph/sourcegraph + run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - name: Generate SCIP data run: scip-go