Repository: google/go-github
File: github/dependabot_alerts.go (Go)

Code before:
// Dependency represents the vulnerable dependency.
type Dependency struct {
	Package      *VulnerabilityPackage `json:"package,omitempty"`
	ManifestPath *string               `json:"manifest_path,omitempty"`
	Scope        *string               `json:"scope,omitempty"`
}

// AdvisoryCVSS represents the advisory pertaining to the Common Vulnerability Scoring System.
type AdvisoryCVSS struct {
	Score        *float64 `json:"score,omitempty"`
	VectorString *string  `json:"vector_string,omitempty"`
}

// AdvisoryCWEs represent the advisory pertaining to Common Weakness Enumeration.
type AdvisoryCWEs struct {
	CWEID *string `json:"cwe_id,omitempty"`
	Name  *string `json:"name,omitempty"`
}

// AdvisoryEPSS represents the advisory pertaining to the Exploit Prediction Scoring System.
//
// For more information, see:
// https://github.blog/changelog/2024-10-10-epss-scores-in-the-github-advisory-database/
type AdvisoryEPSS struct {
	Percentage *float64 `json:"percentage"`
	Percentile *float64 `json:"percentile"`
}

// DependabotSecurityAdvisory represents the GitHub Security Advisory.
type DependabotSecurityAdvisory struct {
	GHSAID          *string                  `json:"ghsa_id,omitempty"`
	CVEID           *string                  `json:"cve_id,omitempty"`
	Summary         *string                  `json:"summary,omitempty"`
	Description     *string                  `json:"description,omitempty"`
	Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"`
	Severity        *string                  `json:"severity,omitempty"`
	CVSS            *AdvisoryCVSS            `json:"cvss,omitempty"`
	CWEs            []*AdvisoryCWEs          `json:"cwes,omitempty"`
	EPSS            *AdvisoryEPSS            `json:"epss,omitempty"`
	Identifiers     []*AdvisoryIdentifier    `json:"identifiers,omitempty"`
	References      []*AdvisoryReference     `json:"references,omitempty"`
	PublishedAt     *Timestamp               `json:"published_at,omitempty"`
	UpdatedAt       *Timestamp               `json:"updated_at,omitempty"`
	WithdrawnAt     *Timestamp               `json:"withdrawn_at,omitempty"`
}

// DependabotAlert represents a Dependabot alert.
type DependabotAlert struct {
	Number                *int                        `json:"number,omitempty"`
	State                 *string                     `json:"state,omitempty"`
	Dependency            *Dependency                 `json:"dependency,omitempty"`

Review comment (suggestion):
```suggestion
	Percentage float64 `json:"percentage"`
	Percentile float64 `json:"percentile"`
```

Code after:
// Dependency represents the vulnerable dependency.
type Dependency struct {
	Package      *VulnerabilityPackage `json:"package,omitempty"`
	ManifestPath *string               `json:"manifest_path,omitempty"`
	Scope        *string               `json:"scope,omitempty"`
}

// AdvisoryCVSS represents the advisory pertaining to the Common Vulnerability Scoring System.
type AdvisoryCVSS struct {
	Score        *float64 `json:"score,omitempty"`
	VectorString *string  `json:"vector_string,omitempty"`
}

// AdvisoryCWEs represent the advisory pertaining to Common Weakness Enumeration.
type AdvisoryCWEs struct {
	CWEID *string `json:"cwe_id,omitempty"`
	Name  *string `json:"name,omitempty"`
}

// AdvisoryEPSS represents the advisory pertaining to the Exploit Prediction Scoring System.
//
// For more information, see:
// https://github.blog/changelog/2024-10-10-epss-scores-in-the-github-advisory-database/
type AdvisoryEPSS struct {
	Percentage float64 `json:"percentage"`
	Percentile float64 `json:"percentile"`
}

// DependabotSecurityAdvisory represents the GitHub Security Advisory.
type DependabotSecurityAdvisory struct {
	GHSAID          *string                  `json:"ghsa_id,omitempty"`
	CVEID           *string                  `json:"cve_id,omitempty"`
	Summary         *string                  `json:"summary,omitempty"`
	Description     *string                  `json:"description,omitempty"`
	Vulnerabilities []*AdvisoryVulnerability `json:"vulnerabilities,omitempty"`
	Severity        *string                  `json:"severity,omitempty"`
	CVSS            *AdvisoryCVSS            `json:"cvss,omitempty"`
	CWEs            []*AdvisoryCWEs          `json:"cwes,omitempty"`
	EPSS            *AdvisoryEPSS            `json:"epss,omitempty"`
	Identifiers     []*AdvisoryIdentifier    `json:"identifiers,omitempty"`
	References      []*AdvisoryReference     `json:"references,omitempty"`
	PublishedAt     *Timestamp               `json:"published_at,omitempty"`
	UpdatedAt       *Timestamp               `json:"updated_at,omitempty"`
	WithdrawnAt     *Timestamp               `json:"withdrawn_at,omitempty"`
}

// DependabotAlert represents a Dependabot alert.
type DependabotAlert struct {
	Number                *int                        `json:"number,omitempty"`
	State                 *string                     `json:"state,omitempty"`
	Dependency            *Dependency                 `json:"dependency,omitempty"`