Skip to content

Pin CI actions to commit SHAs and fix golangci-lint version#82

Merged
LarsLaskowski merged 3 commits into
mainfrom
claude/issue-73-3sw6ln
Jul 17, 2026
Merged

Pin CI actions to commit SHAs and fix golangci-lint version#82
LarsLaskowski merged 3 commits into
mainfrom
claude/issue-73-3sw6ln

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Pin actions/checkout, actions/setup-go, golangci/golangci-lint-action (in ci.yml) and actions/checkout, actions/setup-go, goreleaser/goreleaser-action (in release.yml) to full commit SHAs, with the resolved tag kept as a trailing comment for readability. This closes the supply-chain gap where a compromised or force-moved major-version tag (@v4/@v5/@v6/@v7) could run arbitrary code in CI — notably in release.yml, which holds contents: write.
  • Replace golangci-lint-action's version: latest with an explicit version: v2.12.2, so lint rules no longer change under the project without a commit. Also bumped the action itself from v6 to v7.0.1, since v6 only supports golangci-lint v1 (its v1 line is no longer where upstream releases land — latest is v1.64.8) while v7 supports v2 exclusively, with no other breaking changes per the action's changelog. Verified locally (go install .../golangci-lint@v2.12.2 + golangci-lint run) that this reports 0 issues against the current codebase, and confirmed green in CI on this branch.

goreleaser-action's own version: latest input (the GoReleaser CLI version, not the action) was left unchanged — it's outside this issue's stated scope and its behavior in release.yml can't be exercised in this environment (needs a real tag push + GITHUB_TOKEN).

Related Issue

Closes #73

Checklist

  • Tests added/updated for the change (go test ./... passes locally) — N/A, workflow-only change; existing suite still passes.
  • go vet ./... and golangci-lint run are clean
  • Documentation updated if this changes the REST API (docs/API.md), configuration (README.md, packaging/pimonitor.example.yaml), or installation/packaging (packaging/install.sh, systemd units) — N/A, no such changes.
  • No breaking change to /api/v1/... response shapes, or a new API version was introduced instead — N/A, no API changes.

claude added 3 commits July 17, 2026 16:36
Unpinned major-version tags (@v4, @v5, @v6) let a compromised or
force-moved upstream tag run arbitrary code in CI, and the release
workflow holds contents: write. golangci-lint-action's version: latest
also let lint rules change under the project without a commit.

Pin actions/checkout, actions/setup-go, golangci-lint-action, and
goreleaser-action to full commit SHAs (tag noted in a trailing
comment), and pin golangci-lint itself to v2.5.0, the version already
verified to lint this repo cleanly.

Closes #73
golangci-lint-action@v6 (pinned in the previous commit) rejects any
v2.x version string outright ("golangci-lint v2 is not supported by
golangci-lint-action v6, you must update to golangci-lint-action v7"),
which broke CI. Use v1.64.8 instead, the latest v1.x release, verified
locally to lint this repo with 0 issues.
golangci-lint's v1 line is no longer where new releases land upstream
(latest is v1.64.8, several versions behind current v2.x), so pinning
to it would mean starting this fix already on an aging branch.
golangci-lint-action v7 supports v2 exclusively (v6 only supported
v1), with no other breaking changes per its changelog. Verified
v2.12.2 lints this repo with 0 issues locally via `go install`.
@LarsLaskowski
LarsLaskowski merged commit 5306e93 into main Jul 17, 2026
3 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/issue-73-3sw6ln branch July 17, 2026 16:47
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.

Supply chain: CI actions and golangci-lint are unpinned (version: latest)

2 participants