Skip to content

Commit 554b805

Browse files
authored
add required github config (#1113)
* add required github config * set no username in git cfg * use different syntax on windows
1 parent f51f817 commit 554b805

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

.github/workflows/go-ci.yml

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ jobs:
2121
uses: actions/setup-go@v5
2222
with:
2323
go-version: ${{ matrix.go-version }}
24+
- name: (Windows) Enable pulling Go modules from private sourcegraph/sourcegraph
25+
if: runner.os == 'Windows'
26+
run: git config --global url."https://$env:[email protected]/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
27+
- name: (Default) Enable pulling Go modules from private sourcegraph/sourcegraph
28+
if: runner.os != 'Windows'
29+
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
2430
- run: |
2531
go test -race -v ./...
2632
go test -v ./...

.github/workflows/go-lint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ jobs:
1717
uses: actions/setup-go@v5
1818
with:
1919
go-version: 1.22.5
20+
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
21+
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
2022
- run: ./dev/go-lint.sh

.github/workflows/goreleaser-check.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
uses: actions/setup-go@v5
2121
with:
2222
go-version: 1.22.5
23+
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
24+
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
2325
- name: Check GoReleaser config
2426
uses: goreleaser/goreleaser-action@v5
2527
with:

.github/workflows/goreleaser.yml

+2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ jobs:
182182
uses: actions/setup-go@v5
183183
with:
184184
go-version: 1.22.5
185+
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
186+
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
185187
- run: go test ./...
186188
- run: go test -race -v ./...
187189
- run: echo "${DOCKER_PASSWORD}" | docker login -u=$DOCKER_USERNAME --password-stdin

.github/workflows/scip.yml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
chmod +x /usr/local/bin/src
1717
- name: Set directory to safe for git
1818
run: git config --global --add safe.directory $GITHUB_WORKSPACE
19+
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
20+
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
1921
- name: Generate SCIP data
2022
run: scip-go
2123

0 commit comments

Comments
 (0)