mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 00:45:36 +03:00
Replace checker.Release
with clients.Release
(#1946)
Co-authored-by: Azeem Shaikh <azeems@google.com>
This commit is contained in:
parent
33e3106320
commit
9a2a4f16bd
@ -93,7 +93,7 @@ type BinaryArtifactData struct {
|
||||
// SignedReleasesData contains the raw results
|
||||
// for the Signed-Releases check.
|
||||
type SignedReleasesData struct {
|
||||
Releases []Release
|
||||
Releases []clients.Release
|
||||
}
|
||||
|
||||
// DependencyUpdateToolData contains the raw results
|
||||
@ -271,20 +271,6 @@ type Vulnerability struct {
|
||||
// TODO(vuln): Add additional fields, if needed.
|
||||
}
|
||||
|
||||
// Release represents a project release.
|
||||
type Release struct {
|
||||
Tag string
|
||||
URL string
|
||||
Assets []ReleaseAsset
|
||||
// TODO: add needed fields, e.g. Path.
|
||||
}
|
||||
|
||||
// ReleaseAsset represents a release asset.
|
||||
type ReleaseAsset struct {
|
||||
Name string
|
||||
URL string
|
||||
}
|
||||
|
||||
// CIIBestPracticesData contains data foor CIIBestPractices check.
|
||||
type CIIBestPracticesData struct {
|
||||
Badge clients.BadgeLevel
|
||||
|
@ -42,7 +42,7 @@ func SignedReleases(name string, dl checker.DetailLogger, r *checker.SignedRelea
|
||||
}
|
||||
|
||||
dl.Debug(&checker.LogMessage{
|
||||
Text: fmt.Sprintf("GitHub release found: %s", release.Tag),
|
||||
Text: fmt.Sprintf("GitHub release found: %s", release.TagName),
|
||||
})
|
||||
|
||||
totalReleases++
|
||||
@ -70,7 +70,7 @@ func SignedReleases(name string, dl checker.DetailLogger, r *checker.SignedRelea
|
||||
dl.Warn(&checker.LogMessage{
|
||||
Path: release.URL,
|
||||
Type: checker.FileTypeURL,
|
||||
Text: fmt.Sprintf("release artifact %s not signed", release.Tag),
|
||||
Text: fmt.Sprintf("release artifact %s not signed", release.TagName),
|
||||
})
|
||||
}
|
||||
if totalReleases >= releaseLookBack {
|
||||
|
@ -27,23 +27,7 @@ func SignedReleases(c *checker.CheckRequest) (checker.SignedReleasesData, error)
|
||||
return checker.SignedReleasesData{}, fmt.Errorf("%w", err)
|
||||
}
|
||||
|
||||
var results checker.SignedReleasesData
|
||||
for i, r := range releases {
|
||||
results.Releases = append(results.Releases,
|
||||
checker.Release{
|
||||
Tag: r.TagName,
|
||||
URL: r.URL,
|
||||
})
|
||||
|
||||
for _, asset := range r.Assets {
|
||||
a := checker.ReleaseAsset{
|
||||
URL: asset.URL,
|
||||
Name: asset.Name,
|
||||
}
|
||||
results.Releases[i].Assets = append(results.Releases[i].Assets, a)
|
||||
}
|
||||
}
|
||||
|
||||
// Return raw results.
|
||||
return results, nil
|
||||
return checker.SignedReleasesData{
|
||||
Releases: releases,
|
||||
}, nil
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ func (r *jsonScorecardRawResult) addSignedReleasesRawResults(sr *checker.SignedR
|
||||
for i, release := range sr.Releases {
|
||||
r.Results.Releases = append(r.Results.Releases,
|
||||
jsonRelease{
|
||||
Tag: release.Tag,
|
||||
Tag: release.TagName,
|
||||
URL: release.URL,
|
||||
})
|
||||
for _, asset := range release.Assets {
|
||||
|
Loading…
Reference in New Issue
Block a user