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

Add Repository struct to SecretScanningAlert #2823

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions github/secret_scanning.go
Expand Up @@ -16,17 +16,18 @@ type SecretScanningService service

// SecretScanningAlert represents a GitHub secret scanning alert.
type SecretScanningAlert struct {
Number *int `json:"number,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
LocationsURL *string `json:"locations_url,omitempty"`
State *string `json:"state,omitempty"`
Resolution *string `json:"resolution,omitempty"`
ResolvedAt *Timestamp `json:"resolved_at,omitempty"`
ResolvedBy *User `json:"resolved_by,omitempty"`
SecretType *string `json:"secret_type,omitempty"`
Secret *string `json:"secret,omitempty"`
Number *int `json:"number,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
LocationsURL *string `json:"locations_url,omitempty"`
State *string `json:"state,omitempty"`
Resolution *string `json:"resolution,omitempty"`
ResolvedAt *Timestamp `json:"resolved_at,omitempty"`
ResolvedBy *User `json:"resolved_by,omitempty"`
SecretType *string `json:"secret_type,omitempty"`
Secret *string `json:"secret,omitempty"`
Repository *Repository `json:"repository,omitempty"`
}

// SecretScanningAlertLocation represents the location for a secret scanning alert.
Expand Down
12 changes: 11 additions & 1 deletion github/secret_scanning_test.go
Expand Up @@ -35,7 +35,12 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) {
"resolved_at": null,
"resolved_by": null,
"secret_type": "mailchimp_api_key",
"secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"
"secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2",
"repository": {
"id": 1,
"name": "n",
"url": "url"
}
}]`)
})

Expand All @@ -61,6 +66,11 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) {
ResolvedBy: nil,
SecretType: String("mailchimp_api_key"),
Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"),
Repository: &Repository{
ID: Int64(1),
URL: String("url"),
Name: String("n"),
},
},
}

Expand Down