Skip to content

Commit 9a30ff0

Browse files
committed
Fix API endpoint by reading the docs
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
1 parent bad4743 commit 9a30ff0

4 files changed

Lines changed: 8 additions & 46 deletions

File tree

github/github-accessors.go

Lines changed: 0 additions & 16 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: 0 additions & 20 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: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,13 @@ type SecretScanningAlertListOptions struct {
8080

8181
// SecretScanningAlertUpdateOptions specifies optional parameters to the SecretScanningService.UpdateAlert method.
8282
type SecretScanningAlertUpdateOptions struct {
83-
// Required. Sets the state of the secret scanning alert. Can be either open or resolved.
84-
// You must provide resolution when you set the state to resolved.
85-
State *string `json:"state,omitempty"`
83+
// State is required and sets the state of the secret scanning alert.
84+
// Can be either "open" or "resolved".
85+
// You must provide resolution when you set the state to "resolved".
86+
State string `json:"state"`
8687

87-
// A comma-separated list of secret types to return. By default all secret types are returned.
88-
SecretType *string `json:"secret_type,omitempty"`
89-
90-
// Required when the state is resolved. The reason for resolving the alert. Can be one of false_positive,
91-
// wont_fix, revoked, or used_in_tests.
88+
// Required when the state is "resolved" and represents the reason for resolving the alert.
89+
// Can be one of: "false_positive", "wont_fix", "revoked", or "used_in_tests".
9290
Resolution *string `json:"resolution,omitempty"`
9391
}
9492

github/secret_scanning_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) {
359359
v := new(SecretScanningAlertUpdateOptions)
360360
assertNilError(t, json.NewDecoder(r.Body).Decode(v))
361361

362-
want := &SecretScanningAlertUpdateOptions{State: String("resolved"), Resolution: String("used_in_tests")}
362+
want := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests")}
363363

364364
if !cmp.Equal(v, want) {
365365
t.Errorf("Request body = %+v, want %+v", v, want)
@@ -381,7 +381,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) {
381381
})
382382

383383
ctx := context.Background()
384-
opts := &SecretScanningAlertUpdateOptions{State: String("resolved"), Resolution: String("used_in_tests")}
384+
opts := &SecretScanningAlertUpdateOptions{State: "resolved", Resolution: String("used_in_tests")}
385385

386386
alert, _, err := client.SecretScanning.UpdateAlert(ctx, "o", "r", 1, opts)
387387
if err != nil {

0 commit comments

Comments
 (0)