Skip to content

Commit cd4cbb3

Browse files
committed
Use sourcegraph/actions/go-setup for Go setup
1 parent a51fee1 commit cd4cbb3

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

.github/workflows/go-ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,10 @@ jobs:
2121
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
2222
shell: bash
2323
- name: Set up Go
24-
uses: actions/setup-go@v6
24+
uses: sourcegraph/actions/go-setup@main
2525
with:
2626
go-version: ${{ steps.mise.outputs.go-version }}
27-
- name: (Windows) Enable pulling Go modules from private sourcegraph/sourcegraph
28-
if: runner.os == 'Windows'
29-
run: git config --global url."https://$env:PRIVATE_TOKEN@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
30-
- name: (Default) Enable pulling Go modules from private sourcegraph/sourcegraph
31-
if: runner.os != 'Windows'
32-
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
27+
private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}
3328
- run: |
3429
go test -race -v ./...
3530
go test -v ./...

.github/workflows/go-lint.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ jobs:
1717
id: mise
1818
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
1919
- name: Set up Go
20-
uses: actions/setup-go@v6
20+
uses: sourcegraph/actions/go-setup@main
2121
with:
2222
go-version: ${{ steps.mise.outputs.go-version }}
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/"
23+
private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}
2524
- run: ./dev/go-lint.sh

.github/workflows/goreleaser-check.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ jobs:
2020
id: mise
2121
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
2222
- name: Set up Go
23-
uses: actions/setup-go@v6
23+
uses: sourcegraph/actions/go-setup@main
2424
with:
2525
go-version: ${{ steps.mise.outputs.go-version }}
26-
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
27-
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
26+
private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}
2827
- name: Check GoReleaser config
2928
uses: goreleaser/goreleaser-action@v5
3029
with:

.github/workflows/goreleaser.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,10 @@ jobs:
182182
id: mise
183183
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
184184
- name: Set up Go
185-
uses: actions/setup-go@v6
185+
uses: sourcegraph/actions/go-setup@main
186186
with:
187187
go-version: ${{ steps.mise.outputs.go-version }}
188-
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
189-
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
188+
private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}
190189
- run: go test ./...
191190
- run: go test -race -v ./...
192191
- run: echo "${DOCKER_PASSWORD}" | docker login -u=$DOCKER_USERNAME --password-stdin

.github/workflows/scip.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,17 @@ jobs:
1515
id: mise
1616
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
1717
- name: Set up Go
18-
uses: actions/setup-go@v6
18+
uses: sourcegraph/actions/go-setup@main
1919
with:
2020
go-version: ${{ steps.mise.outputs.go-version }}
21+
private-token: ${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}
2122

2223
- name: Set directory to safe for git
2324
run: git config --global --add safe.directory $GITHUB_WORKSPACE
2425

2526
- name: Build src-cli
2627
run: go build -o ./src-cli ./cmd/src
2728

28-
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
29-
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
30-
3129
- name: Generate SCIP data
3230
run: scip-go
3331

0 commit comments

Comments
 (0)