Skip to content

Commit 3a65558

Browse files
ci: verify go.mod and go.sum stay in sync on PRs
Add a go-mod-sync job that runs go mod tidy and fails if go.mod or go.sum drift from the module graph.
1 parent 017cd5e commit 3a65558

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/pull-request-main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ on:
77
- main
88

99
jobs:
10+
go-mod-sync:
11+
name: Go Mod Tidy
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-go@v5
17+
with:
18+
go-version-file: go.mod
19+
cache: true
20+
21+
- name: Ensure go.mod and go.sum match module graph
22+
run: |
23+
go mod tidy
24+
git diff --exit-code go.mod go.sum
25+
1026
ci-lint:
1127
name: Lint
1228
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)