Skip to content

Harden CI and make its lint step actually lint - #2

Merged
peterhoneder merged 1 commit into
mainfrom
ci-and-lint
Sep 1, 2026
Merged

Harden CI and make its lint step actually lint#2
peterhoneder merged 1 commit into
mainfrom
ci-and-lint

Conversation

@peterhoneder

Copy link
Copy Markdown
Owner

The check job ran pull request code with a writable token, no time limit, and actions on mutable tags. Its lint step ran no linter at all.

.github/workflows/ci.yml:

  • Read-only token.
  • persist-credentials: false, so the token is not left in .git/config.
  • timeout-minutes on both jobs, instead of the 6 hour default.
  • Actions pinned to commit SHAs.
  • Force-pushing a PR cancels the superseded run.
  • Installs golangci-lint from a pinned, checksummed tarball. The runner image does not ship one.

Makefile: make lint now fails when golangci-lint is missing and CI is set, instead of falling back to go vet.

.golangci.yml: new. Removes the default output limits, which cap findings at 3 of a kind and 50 per linter and keep only one per line.

.github/dependabot.yml: new. Keeps the pins current.

23 lint fixes, so the job passes. Mostly unchecked error returns from Close and Fprintf. Three others: tint.NewHandler is deprecated, replaced with tint.NewTextHandler; a deliberately discarded config.Load return now uses _; one switch is now tagged.

Fork PRs are gated by a repository setting rather than this file. It is set to require approval for all outside collaborators.

Claude-Session: https://claude.ai/code/session_01FnZG8whBis7HMNVNAWFxDr

The check job ran pull request code with a writable token, no time limit, and
actions on mutable tags. Its lint step ran no linter at all.

.github/workflows/ci.yml:
- Read-only token.
- persist-credentials: false, so the token is not left in .git/config.
- timeout-minutes on both jobs, instead of the 6 hour default.
- Actions pinned to commit SHAs.
- Force-pushing a PR cancels the superseded run.
- Installs golangci-lint from a pinned, checksummed tarball. The runner image
  does not ship one.

Makefile: make lint now fails when golangci-lint is missing and CI is set,
instead of falling back to go vet.

.golangci.yml: new. Removes the default output limits, which cap findings at 3
of a kind and 50 per linter and keep only one per line.

.github/dependabot.yml: new. Keeps the pins current.

23 lint fixes, so the job passes. Mostly unchecked error returns from Close and
Fprintf. Three others: tint.NewHandler is deprecated, replaced with
tint.NewTextHandler; a deliberately discarded config.Load return now uses _; one
switch is now tagged.

Fork PRs are gated by a repository setting rather than this file. It is set to
require approval for all outside collaborators.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FnZG8whBis7HMNVNAWFxDr
@peterhoneder
peterhoneder merged commit 9d17e89 into main Sep 1, 2026
2 checks passed
@peterhoneder
peterhoneder deleted the ci-and-lint branch September 1, 2026 11:36
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