Skip to content

Commit ae355c9

Browse files
committed
🤖 ci: remove duplicate Go version input in govulncheck step
Use `go-version-input` for `golang/govulncheck-action` instead of `go-version-file` to avoid setup-go warnings about both version input modes being set. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.09`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.09 -->
1 parent 1eba173 commit ae355c9

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,24 @@ jobs:
9898
- name: Run golangci-lint formatter checks
9999
run: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.8.0 fmt --diff
100100

101+
- name: Detect Go version from go.mod
102+
id: govulncheck-go-version
103+
# govulncheck-action v1 passes both go-version and go-version-file to setup-go.
104+
# setup-go prioritizes go-version and warns when both are set, so we parse
105+
# go.mod ourselves and forward it via go-version-input to keep go.mod as the
106+
# single source of truth without duplicate-input warnings.
107+
run: |
108+
GO_VERSION="$(awk '/^go / { print $2; exit }' go.mod)"
109+
if [ -z "$GO_VERSION" ]; then
110+
echo "assertion failed: expected go.mod to contain a go directive" >&2
111+
exit 1
112+
fi
113+
echo "value=$GO_VERSION" >> "$GITHUB_OUTPUT"
114+
101115
- name: Run govulncheck
102116
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1
103117
with:
104-
go-version-file: go.mod
118+
go-version-input: ${{ steps.govulncheck-go-version.outputs.value }}
105119
go-package: ./...
106120

107121
test:

0 commit comments

Comments
 (0)