Skip to content

Commit 7a8ab98

Browse files
author
Emil V
authored
Add Repository struct to SecretScanningAlert (#2823)
1 parent 96726d8 commit 7a8ab98

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed

github/github-accessors.go

Lines changed: 8 additions & 0 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: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/secret_scanning.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ type SecretScanningService service
1616

1717
// SecretScanningAlert represents a GitHub secret scanning alert.
1818
type SecretScanningAlert struct {
19-
Number *int `json:"number,omitempty"`
20-
CreatedAt *Timestamp `json:"created_at,omitempty"`
21-
URL *string `json:"url,omitempty"`
22-
HTMLURL *string `json:"html_url,omitempty"`
23-
LocationsURL *string `json:"locations_url,omitempty"`
24-
State *string `json:"state,omitempty"`
25-
Resolution *string `json:"resolution,omitempty"`
26-
ResolvedAt *Timestamp `json:"resolved_at,omitempty"`
27-
ResolvedBy *User `json:"resolved_by,omitempty"`
28-
SecretType *string `json:"secret_type,omitempty"`
29-
Secret *string `json:"secret,omitempty"`
19+
Number *int `json:"number,omitempty"`
20+
CreatedAt *Timestamp `json:"created_at,omitempty"`
21+
URL *string `json:"url,omitempty"`
22+
HTMLURL *string `json:"html_url,omitempty"`
23+
LocationsURL *string `json:"locations_url,omitempty"`
24+
State *string `json:"state,omitempty"`
25+
Resolution *string `json:"resolution,omitempty"`
26+
ResolvedAt *Timestamp `json:"resolved_at,omitempty"`
27+
ResolvedBy *User `json:"resolved_by,omitempty"`
28+
SecretType *string `json:"secret_type,omitempty"`
29+
Secret *string `json:"secret,omitempty"`
30+
Repository *Repository `json:"repository,omitempty"`
3031
}
3132

3233
// SecretScanningAlertLocation represents the location for a secret scanning alert.

github/secret_scanning_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) {
3535
"resolved_at": null,
3636
"resolved_by": null,
3737
"secret_type": "mailchimp_api_key",
38-
"secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"
38+
"secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2",
39+
"repository": {
40+
"id": 1,
41+
"name": "n",
42+
"url": "url"
43+
}
3944
}]`)
4045
})
4146

@@ -61,6 +66,11 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) {
6166
ResolvedBy: nil,
6267
SecretType: String("mailchimp_api_key"),
6368
Secret: String("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2"),
69+
Repository: &Repository{
70+
ID: Int64(1),
71+
URL: String("url"),
72+
Name: String("n"),
73+
},
6474
},
6575
}
6676

0 commit comments

Comments
 (0)