Skip to content

Commit 499148f

Browse files
maxffarrellclaude
andcommitted
fix: Resolve lint errors from API version 2026-03-10 migration
Rename CVSS struct fields to use all-caps initialism (CvssV3 → CVSSV3, CvssV4 → CVSSV4, CvssSeverities → CVSSSeverities), update the verifyartifact example to fetch bundles via BundleURL instead of the removed Bundle field, and fix gci formatting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 80422f6 commit 499148f

7 files changed

Lines changed: 139 additions & 128 deletions

File tree

example/verifyartifact/main.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import (
1515
"encoding/json"
1616
"flag"
1717
"fmt"
18+
"io"
1819
"log"
20+
"net/http"
1921
"os"
2022

2123
"github.com/google/go-github/v84/github"
@@ -102,16 +104,25 @@ func main() {
102104
log.Fatal(err)
103105
}
104106

105-
var b *bundle.Bundle
106107
for _, attestation := range attestations.Attestations {
107-
if err := json.Unmarshal(attestation.Bundle, &b); err != nil {
108+
resp, err := http.Get(attestation.GetBundleURL())
109+
if err != nil {
108110
log.Fatal(err)
109111
}
110-
111-
err := runVerification(sev, pb, b)
112+
body, err := io.ReadAll(resp.Body)
113+
resp.Body.Close()
112114
if err != nil {
113115
log.Fatal(err)
114116
}
117+
118+
var b *bundle.Bundle
119+
if err := json.Unmarshal(body, &b); err != nil {
120+
log.Fatal(err)
121+
}
122+
123+
if err := runVerification(sev, pb, b); err != nil {
124+
log.Fatal(err)
125+
}
115126
}
116127
}
117128

github/dependabot_alerts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ type AdvisoryCVSS struct {
2525

2626
// AdvisoryCvssSeverities contains CVSS v3 and v4 severity information for a security advisory.
2727
type AdvisoryCvssSeverities struct {
28-
CvssV3 *AdvisoryCVSS `json:"cvss_v3,omitempty"`
29-
CvssV4 *AdvisoryCVSS `json:"cvss_v4,omitempty"`
28+
CVSSV3 *AdvisoryCVSS `json:"cvss_v3,omitempty"`
29+
CVSSV4 *AdvisoryCVSS `json:"cvss_v4,omitempty"`
3030
}
3131

3232
// AdvisoryCWEs represent the advisory pertaining to Common Weakness Enumeration.
@@ -53,7 +53,7 @@ type DependabotSecurityAdvisory struct {
5353
Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"`
5454
Severity *string `json:"severity,omitempty"`
5555
CVSS *AdvisoryCVSS `json:"cvss,omitempty"`
56-
CvssSeverities *AdvisoryCvssSeverities `json:"cvss_severities,omitempty"`
56+
CVSSSeverities *AdvisoryCvssSeverities `json:"cvss_severities,omitempty"`
5757
CWEs []*AdvisoryCWEs `json:"cwes,omitempty"`
5858
EPSS *AdvisoryEPSS `json:"epss,omitempty"`
5959
Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"`

github/event_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ type WorkflowRunEvent struct {
18841884
// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory
18851885
type SecurityAdvisory struct {
18861886
CVSS *AdvisoryCVSS `json:"cvss,omitempty"`
1887-
CvssSeverities *AdvisoryCvssSeverities `json:"cvss_severities,omitempty"`
1887+
CVSSSeverities *AdvisoryCvssSeverities `json:"cvss_severities,omitempty"`
18881888
CWEs []*AdvisoryCWEs `json:"cwes,omitempty"`
18891889
GHSAID *string `json:"ghsa_id,omitempty"`
18901890
Summary *string `json:"summary,omitempty"`

github/github-accessors.go

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/issues.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ func (i Issue) IsPullRequest() bool {
8787
// It is separate from Issue above because otherwise Labels
8888
// and Assignees fail to serialize to the correct JSON.
8989
type IssueRequest struct {
90-
Title *string `json:"title,omitempty"`
91-
Body *string `json:"body,omitempty"`
92-
Labels *[]string `json:"labels,omitempty"`
93-
State *string `json:"state,omitempty"`
90+
Title *string `json:"title,omitempty"`
91+
Body *string `json:"body,omitempty"`
92+
Labels *[]string `json:"labels,omitempty"`
93+
State *string `json:"state,omitempty"`
9494
// StateReason can be 'completed' or 'not_planned'.
9595
StateReason *string `json:"state_reason,omitempty"`
9696
Milestone *int `json:"milestone,omitempty"`

0 commit comments

Comments
 (0)