Skip to content

Commit 3937292

Browse files
Merge branch 'main' into fix-improve-error-messages
2 parents d3d35f7 + ad16cda commit 3937292

File tree

8 files changed

+10
-43
lines changed

8 files changed

+10
-43
lines changed

.github/workflows/go-ci.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: Go CI
33
on:
44
workflow_dispatch:
55
push:
6-
env:
7-
GOPRIVATE: "github.com/sourcegraph/*"
8-
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"
9-
106
jobs:
117
go-test:
128
strategy:
@@ -21,15 +17,9 @@ jobs:
2117
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
2218
shell: bash
2319
- name: Set up Go
24-
uses: actions/setup-go@v6
20+
uses: sourcegraph/actions/go-setup@main
2521
with:
2622
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/"
3323
- run: |
3424
go test -race -v ./...
3525
go test -v ./...

.github/workflows/go-lint.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: Go Lint
33
on:
44
workflow_dispatch:
55
push:
6-
env:
7-
GOPRIVATE: "github.com/sourcegraph/*"
8-
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"
96

107
jobs:
118
go-lint:
@@ -17,9 +14,7 @@ jobs:
1714
id: mise
1815
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
1916
- name: Set up Go
20-
uses: actions/setup-go@v6
17+
uses: sourcegraph/actions/go-setup@main
2118
with:
2219
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/"
2520
- run: ./dev/go-lint.sh

.github/workflows/goreleaser-check.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: GoReleaser check
33
on:
44
push:
55
workflow_dispatch:
6-
env:
7-
GOPRIVATE: "github.com/sourcegraph/*"
8-
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"
9-
106
jobs:
117
goreleaser:
128
name: check
@@ -20,11 +16,9 @@ jobs:
2016
id: mise
2117
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
2218
- name: Set up Go
23-
uses: actions/setup-go@v6
19+
uses: sourcegraph/actions/go-setup@main
2420
with:
2521
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/"
2822
- name: Check GoReleaser config
2923
uses: goreleaser/goreleaser-action@v5
3024
with:

.github/workflows/goreleaser.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
push:
66
tags:
77
- '*'
8-
env:
9-
GOPRIVATE: "github.com/sourcegraph/*"
10-
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"
11-
128
# There are two cases where this GitHub action will run:
139
#
1410
# 1. We are releasing a new latest version for src-cli, as a major, minor, or patch
@@ -182,11 +178,9 @@ jobs:
182178
id: mise
183179
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
184180
- name: Set up Go
185-
uses: actions/setup-go@v6
181+
uses: sourcegraph/actions/go-setup@main
186182
with:
187183
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/"
190184
- run: go test ./...
191185
- run: go test -race -v ./...
192186
- run: echo "${DOCKER_PASSWORD}" | docker login -u=$DOCKER_USERNAME --password-stdin

.github/workflows/scip.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: SCIP
22
on:
33
workflow_dispatch:
44
push:
5-
env:
6-
GOPRIVATE: "github.com/sourcegraph/*"
7-
PRIVATE_TOKEN: "${{ secrets.PRIVATE_SG_ACCESS_TOKEN }}"
85
jobs:
96
scip-go:
107
runs-on: ubuntu-latest
@@ -15,7 +12,7 @@ jobs:
1512
id: mise
1613
run: echo "go-version=$(grep 'golang' mise.toml | cut -d'"' -f2)" >> $GITHUB_OUTPUT
1714
- name: Set up Go
18-
uses: actions/setup-go@v6
15+
uses: sourcegraph/actions/go-setup@main
1916
with:
2017
go-version: ${{ steps.mise.outputs.go-version }}
2118

@@ -25,9 +22,6 @@ jobs:
2522
- name: Build src-cli
2623
run: go build -o ./src-cli ./cmd/src
2724

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-
3125
- name: Generate SCIP data
3226
run: scip-go
3327

dev/golangci-lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
66

77
mkdir -p dev/.bin
88

9-
version="2.6.1"
9+
version="2.10.1"
1010
suffix="${version}-$(go env GOOS)-$(go env GOARCH)"
1111
target="$PWD/dev/.bin/golangci-lint-${suffix}"
1212
url="https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${suffix}.tar.gz"

internal/batches/executor/run_steps.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ func (e stepFailedErr) Error() string {
660660
return lines[0] + fmt.Sprintf("\n\t(... and %d more lines)", len(lines)-1)
661661
}
662662

663-
out.WriteString(fmt.Sprintf("run: %s\ncontainer: %s\n", fmtRun(e.Run), e.Container))
663+
fmt.Fprintf(&out, "run: %s\ncontainer: %s\n", fmtRun(e.Run), e.Container)
664664

665665
printOutput := func(output string) {
666666
for line := range strings.SplitSeq(output, "\n") {
@@ -682,9 +682,9 @@ func (e stepFailedErr) Error() string {
682682
}
683683

684684
if e.ExitCode != -1 {
685-
out.WriteString(fmt.Sprintf("\nCommand failed with exit code %d.", e.ExitCode))
685+
fmt.Fprintf(&out, "\nCommand failed with exit code %d.", e.ExitCode)
686686
} else {
687-
out.WriteString(fmt.Sprintf("\nCommand failed: %s", e.Err))
687+
fmt.Fprintf(&out, "\nCommand failed: %s", e.Err)
688688
}
689689

690690
return out.String()

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[tools]
2-
golang = "1.25.4"
2+
golang = "1.26.0"
33
shfmt = "3.8.0"
44
shellcheck = "0.10.0"

0 commit comments

Comments
 (0)