Skip to content

Commit

Permalink
🐛 Token-Permissions: use same text for read token details as write to…
Browse files Browse the repository at this point in the history
…ken details (#4025)

* use same text for read token details as write token details

This was an unintentional regression from v4.13.1

Signed-off-by: Spencer Schrock <sschrock@google.com>

* deal with linter warning

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
  • Loading branch information
spencerschrock committed Apr 12, 2024
1 parent d8b26d9 commit f4c3025
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions checks/evaluation/signed_releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
var errNoReleaseFound = errors.New("no release found")

// SignedReleases applies the score policy for the Signed-Releases check.
//
//nolint:gocognit // surpressing for now
func SignedReleases(name string,
findings []finding.Finding, dl checker.DetailLogger,
) checker.CheckResult {
Expand Down
10 changes: 6 additions & 4 deletions probes/internal/utils/permissions/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ func ReadTrueLevelFinding(probe string,
r checker.TokenPermission,
metadata map[string]string,
) (*finding.Finding, error) {
f, err := finding.NewWith(fs, probe,
"found token with 'read' permissions",
nil, finding.OutcomeTrue)
text, err := createText(r)
if err != nil {
return nil, fmt.Errorf("%w", err)
return nil, err
}
f, err := finding.NewWith(fs, probe, text, nil, finding.OutcomeTrue)
if err != nil {
return nil, fmt.Errorf("create finding: %w", err)
}
if r.File != nil {
f = f.WithLocation(r.File.Location())
Expand Down

0 comments on commit f4c3025

Please sign in to comment.