Skip to content

ci: declare the golangci-lint version in one place - #18

Merged
major0 merged 2 commits into
mainfrom
ci/single-source-golangci-lint-version
Sep 23, 2026
Merged

major0 merged 2 commits into
mainfrom
ci/single-source-golangci-lint-version

Conversation

@major0

@major0 major0 commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

Three places decided which golangci-lint ran, and they disagreed:

Consumer Version
.github/workflows/lint.yml (action version: input) v2.11.4
.github/scripts/install-go-tools.sh (Pre-commit job) v2.13.2
a local checkout whatever the developer happened to install

Both CI jobs lint every pull request, so one commit was checked by two
different linter builds whose findings can diverge.

After this change install-go-tools.sh is the only declaration:

  • lint.yml runs install-go-tools.sh, then passes install-mode: none to
    the action. In that mode the action ignores version: and runs the
    golangci-lint already on PATH — the script appends GOPATH/bin to
    $GITHUB_PATH, which applies to subsequent steps. The action's caching and
    annotations are unaffected.
  • make tools runs the same script, giving a local checkout a supported way to
    install the versions the repository expects.

Verification

  • pre-commit check yaml passes on lint.yml.
  • make help lists tools; make -n tools resolves to
    .github/scripts/install-go-tools.sh.
  • Grep across .github/, Makefile, and .pre-commit-config.yaml confirms
    GOLANGCI_LINT_VERSION in install-go-tools.sh is the only remaining
    version declaration.
  • Not verifiable locally: that install-mode: none resolves the binary from
    $GITHUB_PATH. That needs a CI run on this PR.

Notes

Scope and triggers are unchanged — the Lint job still runs the full module on
every push and pull request. Delta linting stays exclusive to the pre-commit
path (#17).

The Lint job pinned golangci-lint to v2.11.4 through the action's
version input while install-go-tools.sh, used by the Pre-commit job,
pinned v2.13.2. Both jobs lint every pull request, so the same commit
was checked by two different linter builds whose findings can diverge.

Install the tools with the same script the Pre-commit job uses and set
install-mode to none so the action runs the binary already on PATH. In
that mode the version input is ignored, leaving the script as the only
place the version is declared. Caching and annotations are unchanged.

Assisted-by: Kiro <noreply@kiro.dev> (1.0.116)
Nothing in a local checkout declared which golangci-lint version the
repository expects, so a developer's system package could differ from
the version CI installs and report a different set of findings. The
pre-commit hook then fails in CI after passing locally, or passes in
CI after failing locally.

Wire the existing install-go-tools.sh into the Makefile so a local
checkout installs the same pinned versions CI does.

Assisted-by: Kiro <noreply@kiro.dev> (1.0.116)
@major0
major0 merged commit 0d7fb9e into main Sep 23, 2026
11 of 12 checks passed
@major0
major0 deleted the ci/single-source-golangci-lint-version branch September 23, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant