Skip to content
Closed
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion .github/workflows/ci-sync-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ jobs:
with:
go-version-file: 'go.mod'
- name: install cosign
run: go install github.com/sigstore/cosign/v2/cmd/cosign@v2.2.4
run: |
if ! command -v cosign >/dev/null 2>&1 || ! cosign version | grep -q "v2.2.4"; then
echo "Installing cosign v2.2.4..."
go install github.com/sigstore/cosign/v2/cmd/cosign@v2.2.4
else
echo "cosign v2.2.4 already installed"
fi
- name: install goreleaser
run: |
curl -sL https://github.com/goreleaser/goreleaser-pro/releases/download/v1.14.0-pro/goreleaser-pro_Linux_x86_64.tar.gz -o /tmp/goreleaser.tar.gz
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ci-sync-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,13 @@ jobs:
with:
go-version-file: 'go.mod'
- name: install cosign
run: go install github.com/sigstore/cosign/v2/cmd/cosign@v2.2.4
run: |
if ! command -v cosign >/dev/null 2>&1 || ! cosign version | grep -q "v2.2.4"; then
echo "Installing cosign v2.2.4..."
go install github.com/sigstore/cosign/v2/cmd/cosign@v2.2.4
else
echo "cosign v2.2.4 already installed"
fi
- name: install goreleaser
run: |
curl -sL https://github.com/goreleaser/goreleaser-pro/releases/download/v1.14.0-pro/goreleaser-pro_Linux_x86_64.tar.gz -o /tmp/goreleaser.tar.gz
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ jobs:
sudo mv /tmp/goreleaser /usr/local/bin/

- name: install cosign
run: go install github.com/sigstore/cosign/v2/cmd/cosign@v2.2.4
run: |
if ! command -v cosign >/dev/null 2>&1 || ! cosign version | grep -q "v2.2.4"; then
echo "Installing cosign v2.2.4..."
go install github.com/sigstore/cosign/v2/cmd/cosign@v2.2.4
else
echo "cosign v2.2.4 already installed"
fi

- name: Create cosign.pub file
run: echo "${{ secrets.COSIGN_PUBLIC_KEY }}" > cosign.pub
Expand Down
243 changes: 210 additions & 33 deletions go.mod

Large diffs are not rendered by default.

624 changes: 548 additions & 76 deletions go.sum

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion makefiles/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ fmt:
## install the linter
.PHONY: lint/install
lint/install:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
@if ! command -v golangci-lint >/dev/null 2>&1 || ! golangci-lint version | grep -q "$(GOLANGCI_LINT_VERSION)"; then \
echo "Installing golangci-lint $(GOLANGCI_LINT_VERSION)..."; \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION); \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Version Check Fails with Substring Matching

The version checks for cosign and golangci-lint use grep -q for substring matching. This can incorrectly detect installed versions, potentially skipping installation and leading to the wrong tool version being used in CI/release workflows.

Additional Locations (3)

Fix in Cursor Fix in Web

else \
echo "golangci-lint $(GOLANGCI_LINT_VERSION) already installed"; \
fi

## lint all code
.PHONY: lint/all
Expand Down
10 changes: 10 additions & 0 deletions tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build tools

package tools

import (
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/google/addlicense"
_ "github.com/madlambda/benchcheck/cmd/benchcheck"
_ "golang.org/x/tools/cmd/goimports"
)
Loading