Skip to content

Commit 09ef6ab

Browse files
committed
ci(pre-commit): bump gosec pin to v2.28.0 to match CI (#1384)
PR #1384 bumps the CI Security Scanning gosec pin to v2.28.0; align the pre-commit hook so local and CI verdicts stay in agreement. Updates the GOSEC_VERSION pin in scripts/gosec-hook.sh and the doc mentions in the hook config comment. Re-verified with v2.28.0: auto-install to the versioned cache dir works; clean pass on cmd/ + pkg/ + providers/aws in ~1.6 s warm; deliberate G501 (crypto/md5) scratch file fails with exit 1; clean pass restored after removal.
1 parent c969733 commit 09ef6ab

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ repos:
113113
# their owning module (root, pkg/, providers/aws, providers/azure,
114114
# providers/gcp). Fast: never whole-repo, always per-changed-package.
115115
#
116-
# gosec v2.26.1 is auto-installed to
117-
# ~/.cache/pre-commit-gosec/v2.26.1/gosec on first use.
116+
# gosec v2.28.0 is auto-installed to
117+
# ~/.cache/pre-commit-gosec/v2.28.0/gosec on first use.
118118
#
119119
# Exclusion rationale and flag list live in scripts/gosec-hook.sh.
120120
# Keep in sync with the exclude= flags there.

‎scripts/gosec-hook.sh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# files, resolved to their owning module. Fast by design: never scans the whole
66
# repo; each commit triggers at most one gosec invocation per affected module.
77
#
8-
# Version pin: gosec v2.26.1 (matches the securego/gosec SHA pin in ci.yml).
9-
# Installed on first use to ~/.cache/pre-commit-gosec/v2.26.1/gosec; never
8+
# Version pin: gosec v2.28.0 (matches the CI pin in ci.yml, bumped by #1384).
9+
# Installed on first use to ~/.cache/pre-commit-gosec/v2.28.0/gosec; never
1010
# modifies the system-wide gosec binary.
1111
#
1212
# Called by pre-commit with pass_filenames: true and files: \.go$.
@@ -32,7 +32,7 @@
3232

3333
set -euo pipefail
3434

35-
GOSEC_VERSION="2.26.1"
35+
GOSEC_VERSION="2.28.0"
3636
GOSEC_BIN="${HOME}/.cache/pre-commit-gosec/v${GOSEC_VERSION}/gosec"
3737

3838
GOSEC_EXCLUDE="G101,G104,G115,G117,G118,G122,G204,G301,G304,G402,G505,G702,G703,G705,G706"
@@ -51,7 +51,7 @@ ensure_gosec() {
5151
local installed_ver
5252
installed_ver=$(go version -m "$GOSEC_BIN" 2>/dev/null \
5353
| awk '$1=="mod" && $2~/gosec/{print $3}')
54-
# installed_ver is e.g. "v2.26.1"; compare against "v$GOSEC_VERSION".
54+
# installed_ver is e.g. "v2.28.0"; compare against "v$GOSEC_VERSION".
5555
if [[ "$installed_ver" != "v${GOSEC_VERSION}" ]]; then
5656
echo "pre-commit/gosec: cached binary is ${installed_ver:-unknown}, need v${GOSEC_VERSION}; reinstalling" >&2
5757
need_install=1

0 commit comments

Comments
 (0)