mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-17 11:57:12 +03:00
fix (#1277)
This commit is contained in:
parent
1050b1cd60
commit
63e3b92466
@ -15,12 +15,14 @@
|
||||
package checks
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/ossf/scorecard/v3/checker"
|
||||
"github.com/ossf/scorecard/v3/clients/githubrepo"
|
||||
sce "github.com/ossf/scorecard/v3/errors"
|
||||
)
|
||||
|
||||
// CheckSecurityPolicy is the registred name for SecurityPolicy.
|
||||
@ -72,9 +74,6 @@ func SecurityPolicy(c *checker.CheckRequest) checker.CheckResult {
|
||||
return checker.CreateMaxScoreResult(CheckSecurityPolicy, "security policy file detected")
|
||||
}
|
||||
|
||||
// I'm not sure what exactly the following code is supposed to do. It seems to always fail with
|
||||
// Warn: repo unreachable: GET https://api.github.com/repos/systemd/.github: 404 Not Found []
|
||||
|
||||
// https://docs.github.com/en/github/building-a-strong-community/creating-a-default-community-health-file.
|
||||
logger, err := githubrepo.NewLogger(zap.InfoLevel)
|
||||
if err != nil {
|
||||
@ -115,7 +114,8 @@ func SecurityPolicy(c *checker.CheckRequest) checker.CheckResult {
|
||||
if r {
|
||||
return checker.CreateMaxScoreResult(CheckSecurityPolicy, "security policy file detected")
|
||||
}
|
||||
// err != nil
|
||||
case errors.Is(err, sce.ErrRepoUnreachable):
|
||||
break
|
||||
default:
|
||||
return checker.CreateRuntimeErrorResult(CheckSecurityPolicy, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user