Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Pinned-Dependencies: no longer complain about CIFuzz #1319

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions checks/pinned_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,17 @@ func validateGitHubActionWorkflow(pathfn string, content []byte,
// Cannot check further, continue.
continue
}

naveensrinivasan marked this conversation as resolved.
Show resolved Hide resolved
// CIFuzz and CFLite can't be pinned properly
// https://github.com/ossf/scorecard/issues/1305
if isSkipped(execAction.Uses.Value) {
dl.Debug3(&checker.LogMessage{
Path: pathfn, Type: checker.FileTypeSource, Offset: execAction.Uses.Pos.Line, Snippet: execAction.Uses.Value,
Text: fmt.Sprintf("dependency not pinned by hash (job '%v')", jobName),
})
continue
}

// Ensure a hash at least as large as SHA1 is used (40 hex characters).
// Example: action-name@hash
match := hashRegex.Match([]byte(execAction.Uses.Value))
Expand Down Expand Up @@ -676,3 +687,15 @@ func validatePackageManagerFile(name string, dl checker.DetailLogger, data filep
addPinnedResult(pdata, true)
return false, nil
}

func isSkipped(s string) bool {
for _, pattern := range []string{
"google/clusterfuzzlite/actions",
"google/oss-fuzz/infra/cifuzz/actions",
} {
if strings.Contains(s, pattern) {
return true
}
}
return false
}