This commit is contained in:
laurentsimon 2021-11-15 13:42:25 -08:00 committed by GitHub
parent 1050b1cd60
commit 63e3b92466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}