Skip to content

Commit 4f52d61

Browse files
ci: scan notify with supported Go
Keep Go 1.22 for build, vet, and race-test parity on both Ubuntu and Windows notify jobs. On Ubuntu, run a second actions/setup-go@v5 with go-version: stable before installing and running govulncheck@v1.3.0, which requires Go 1.25 or newer and reports 25 reachable standard-library vulnerabilities fixed only in supported Go releases. Pin cache-dependency-path to stations/notify/go.sum on every notify setup-go step so the root-level cache warning clears. Set persist-credentials: false on the checkout steps in both notify jobs (CodeRabbit review comment 3630426956). Windows stays on Go 1.22 without govulncheck. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent cf41254 commit 4f52d61

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,23 @@ jobs:
162162
working-directory: stations/notify
163163
steps:
164164
- uses: actions/checkout@v5
165+
with:
166+
persist-credentials: false
165167
- uses: actions/setup-go@v5
166168
with:
167169
go-version: '1.22'
170+
cache-dependency-path: stations/notify/go.sum
168171
- name: Build
169172
run: go build ./...
170173
- name: Vet
171174
run: go vet ./...
172175
- name: Test
173176
run: go test -race ./...
177+
- name: Setup stable Go for govulncheck
178+
uses: actions/setup-go@v5
179+
with:
180+
go-version: stable
181+
cache-dependency-path: stations/notify/go.sum
174182
- name: Install govulncheck
175183
run: go install golang.org/x/vuln/cmd/govulncheck@v1.3.0
176184
- name: Vulncheck
@@ -186,9 +194,12 @@ jobs:
186194
working-directory: stations/notify
187195
steps:
188196
- uses: actions/checkout@v5
197+
with:
198+
persist-credentials: false
189199
- uses: actions/setup-go@v5
190200
with:
191201
go-version: '1.22'
202+
cache-dependency-path: stations/notify/go.sum
192203
- name: Build
193204
run: go build ./...
194205
- name: Vet

tests/test_ci_workflow.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,22 @@ def test_ci_workflow_runs_notify_go_commands_from_notify_directory():
132132
ubuntu = _workflow_job_section(text, "notify-build-and-test")
133133
assert "runs-on: ubuntu-latest" in ubuntu
134134
assert "working-directory: stations/notify" in ubuntu
135-
assert "uses: actions/setup-go@v5" in ubuntu
136-
assert "go-version: '1.22'" in ubuntu
135+
# Two setup-go v5 steps: Go 1.22 for build parity, then stable for the scanner.
136+
assert ubuntu.count("uses: actions/setup-go@v5") == 2
137+
# Both Go setup steps pin the notify go.sum so the root cache warning clears.
138+
assert ubuntu.count("cache-dependency-path: stations/notify/go.sum") == 2
139+
# Checkout must not persist credentials (CodeRabbit review comment 3630426956).
140+
assert "persist-credentials: false" in ubuntu
141+
# Go 1.22 lane runs build, vet, and race tests before the stable scanner lane.
142+
go122 = ubuntu.index("go-version: '1.22'")
143+
build = ubuntu.index("go build ./...")
144+
assert go122 < build
145+
race = ubuntu.index("go test -race ./...")
146+
# Stable Go lands after the race test and before govulncheck installation.
147+
stable = ubuntu.index("go-version: stable")
148+
assert race < stable
149+
govulncheck_install = ubuntu.index("go install golang.org/x/vuln/cmd/govulncheck@v1.3.0")
150+
assert stable < govulncheck_install
137151
for command in (
138152
"go build ./...",
139153
"go vet ./...",
@@ -148,6 +162,8 @@ def test_ci_workflow_runs_notify_go_commands_from_notify_directory():
148162
assert "working-directory: stations/notify" in windows
149163
assert "uses: actions/setup-go@v5" in windows
150164
assert "go-version: '1.22'" in windows
165+
assert "persist-credentials: false" in windows
166+
assert "cache-dependency-path: stations/notify/go.sum" in windows
151167
for command in (
152168
"go build ./...",
153169
"go vet ./...",

0 commit comments

Comments
 (0)