Skip to content

Commit 62b8395

Browse files
committed
ci(vendor-hash): block major indirect bumps and skip false-positive hooks
PR #977 (the first batched go-indirect run under the new config) surfaced two remaining gaps: 1. Renovate kept attempting major-version bumps on indirect deps (openai-go v1 -> v3, modernc.org/libc v1 -> v2). A new major is a different Go module path, and nothing in the repo imports the new path, so `go mod tidy` strips the added lines on every workflow run. The PR is a guaranteed no-op that never reconciles with main. Disable major update-types for the indirect rule so Renovate stops opening them. 2. When `go mod tidy` does reshape go.sum without altering vendor contents (exactly the scenario above), the Commit and push step trips two pre-commit hooks that fire as false positives here: vendor-hash-check ("go.sum changed but nix/package.nix did not") and go-mod-tidy ("tidy would modify files" -- it already did, we are about to stage the result). Scope SKIP to these two hook IDs on that one step; all other hooks still run.
1 parent 62422ea commit 62b8395

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/update-vendor-hash.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,15 @@ jobs:
128128
run: nix build '.#micasa' --no-link -L
129129

130130
- name: Commit and push
131+
env:
132+
# Skip hooks this workflow would always trip as false positives:
133+
# - vendor-hash-check fires when go.sum is staged but nix/package.nix
134+
# is not, which is exactly the state when `go mod tidy` reshapes
135+
# go.sum without altering vendor contents (this step already ran
136+
# the authoritative hash computation above).
137+
# - go-mod-tidy reruns tidy and complains if it would change files;
138+
# the Tidy go modules step upstream already tidied.
139+
SKIP: vendor-hash-check,go-mod-tidy
131140
run: |
132141
git config user.name "github-actions[bot]"
133142
git config user.email "github-actions[bot]@users.noreply.github.com"

renovate.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
"separateMultipleMajor": false,
2828
"separateMinorPatch": false
2929
},
30+
{
31+
"description": "Never bump indirect Go deps across majors. A new major is a different module path; nothing in this repo imports it, so go mod tidy just strips the new lines again.",
32+
"matchManagers": ["gomod"],
33+
"matchDepTypes": ["indirect"],
34+
"matchUpdateTypes": ["major"],
35+
"enabled": false
36+
},
3037
{
3138
"description": "Group GitHub Actions updates",
3239
"matchManagers": ["github-actions"],

0 commit comments

Comments
 (0)