From a8faa6061f19bf5ebbd8308b45456d5f37be5d1e Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Thu, 3 Dec 2026 12:22:46 +0000 Subject: [PATCH] ci(pr): grant actions read so the shared PR checks start (#242) * ci(pr): grant actions read so the shared PR checks start go-pr.yaml's CodeQL job asks for actions: read. A reusable workflow cannot ask for more than its caller grants, so the whole PR run failed at startup with no jobs. Grant the missing scope. * fix(deps): bump gorilla/websocket past GO-2026-6278 govulncheck reports the weak WebSocket mask-key PRNG in v1.5.3; the fix is v1.5.4-0.20240701034025-d67f41855da4. * test(scanner): drop the unused resultStore.saved helper staticcheck U1000: the tests read store.savedResults directly, so the helper has no callers. --------- Co-authored-by: Bug Fixer --- .github/workflows/pr.yaml | 1 + go.mod | 2 +- go.sum | 2 ++ pkg/scanner/scanner_test.go | 6 ------ 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index ce2ff30..4b35abf 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -10,6 +10,7 @@ on: - "!main" permissions: + actions: read contents: read pull-requests: write security-events: write diff --git a/go.mod b/go.mod index b7f90dd..8193662 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/go-sql-driver/mysql v1.11.0 github.com/goccy/go-json v0.12.0 github.com/gofiber/fiber/v3 v3.7.0 - github.com/gorilla/websocket v1.5.3 + github.com/gorilla/websocket v1.5.4-0.20240701034025-d67f41855da4 github.com/lib/pq v1.12.3 github.com/prometheus/client_golang v1.25.0 github.com/prometheus/client_model v0.6.3 diff --git a/go.sum b/go.sum index 4e551da..8c6157b 100644 --- a/go.sum +++ b/go.sum @@ -119,6 +119,8 @@ github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7Fsg github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.4-0.20240701034025-d67f41855da4 h1:PYKzliEgITjLJoJqbV90S0YRaG8LNAsICH6fp6MApC0= +github.com/gorilla/websocket v1.5.4-0.20240701034025-d67f41855da4/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.4 h1:ZrN80XjMzpRYk+2FxMDy2A2zz0d5QjJ7GMFSkZLj12A= diff --git a/pkg/scanner/scanner_test.go b/pkg/scanner/scanner_test.go index 6d955b7..882d670 100644 --- a/pkg/scanner/scanner_test.go +++ b/pkg/scanner/scanner_test.go @@ -364,12 +364,6 @@ func (m *resultStore) GetScanResult(context.Context, string, string, string) (*m return m.scan, nil } -func (m *resultStore) saved() []*metadata.ScanResult { - m.mu.Lock() - defer m.mu.Unlock() - return append([]*metadata.ScanResult(nil), m.savedResults...) -} - func TestScanPackage_InfrastructureErrorIsMarked(t *testing.T) { store := &stubMetadataStore{} mgr := newTestManager(t, store)