Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4

- name: Cache Go modules
uses: actions/cache@v3
uses: actions/cache@v4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Pin actions to a commit SHA for supply-chain hardening.

zizmor flags both actions/cache@v4 and actions/setup-go@v5 as unpinned. Tag references can be moved/re-tagged; pinning to a commit SHA (with a version comment) is the recommended hardening practice. This mirrors the existing actions/checkout@v4 pattern in the file, so it's a repo-wide convention rather than a new regression, but worth addressing given the blanket policy the linter is enforcing.

🔒 Example of SHA-pinning
-        uses: actions/cache@v4
+        uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf22 # v4.2.0
-        uses: actions/setup-go@v5
+        uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0

Also applies to: 34-34

🧰 Tools
🪛 zizmor (1.26.1)

[error] 24-24: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/go.yml at line 24, The workflow uses unpinned GitHub
Actions references, so update both actions/cache and actions/setup-go in the go
workflow to be pinned to specific commit SHAs instead of version tags. Follow
the existing actions/checkout pattern in the same file by replacing the
tag-based references with SHA-pinned ones and adding the version comment
convention used in the repo. Focus on the cache and Go setup steps so the
workflow remains functionally the same while satisfying the supply-chain
hardening rule.

Source: Linters/SAST tools

with:
path: |
~/.cache/go-build
Expand All @@ -31,14 +31,12 @@ jobs:
${{ runner.os }}-go-modules-

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.23.0"
go-version-file: "go.mod"

- name: Lint with golangci-lint-action
uses: golangci/golangci-lint-action@v4
with:
version: latest
- name: Vet
run: go vet ./...

- name: Build
run: go build -v ./...
Expand Down
Loading