Skip to content

Find, verify, and analyze leaked credentials

prevent concurrent map writes (#2399)

ahravbbf1decb393f
diff --git a/pkg/output/github_actions.go b/pkg/output/github_actions.go
index d8d99eaf2..e6beaaa8c 100644
--- a/pkg/output/github_actions.go
+++ b/pkg/output/github_actions.go
@@ -52,13 +52,13 @@ func (p *GitHubActionsPrinter) Print(_ context.Context, r *detectors.ResultWithM
h := sha256.New()
h.Write([]byte(key))
key = hex.EncodeToString(h.Sum(nil))
+ p.mu.Lock()
+ defer p.mu.Unlock()
if _, ok := dedupeCache[key]; ok {
return nil
}
dedupeCache[key] = struct{}{}
- p.mu.Lock()
- defer p.mu.Unlock()
message := fmt.Sprintf("Found %s %s result πŸ·πŸ”‘\n", verifiedStatus, out.DetectorType)
if r.Result.DecoderType != detectorspb.DecoderType_PLAIN {
message = fmt.Sprintf("Found %s %s result with %s encoding πŸ·πŸ”‘\n", verifiedStatus, out.DetectorType, out.DecoderType)