Skip to content

Commit

Permalink
Merge branch 'master' into scripts-to-rule-them-all
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAbides committed Sep 21, 2023
2 parents 503fad7 + b45ef89 commit 93bbca3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 48 deletions.
16 changes: 0 additions & 16 deletions github/github-accessors.go

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

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

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

18 changes: 8 additions & 10 deletions github/secret_scanning.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ type SecretScanningAlertListOptions struct {

// SecretScanningAlertUpdateOptions specifies optional parameters to the SecretScanningService.UpdateAlert method.
type SecretScanningAlertUpdateOptions struct {
// Required. Sets the state of the secret scanning alert. Can be either open or resolved.
// You must provide resolution when you set the state to resolved.
State *string `url:"state,omitempty"`

// A comma-separated list of secret types to return. By default all secret types are returned.
SecretType *string `url:"secret_type,omitempty"`

// Required when the state is resolved. The reason for resolving the alert. Can be one of false_positive,
// wont_fix, revoked, or used_in_tests.
Resolution *string `url:"resolution,omitempty"`
// State is required and sets the state of the secret scanning alert.
// Can be either "open" or "resolved".
// You must provide resolution when you set the state to "resolved".
State string `json:"state"`

// Required when the state is "resolved" and represents the reason for resolving the alert.
// Can be one of: "false_positive", "wont_fix", "revoked", or "used_in_tests".
Resolution *string `json:"resolution,omitempty"`
}

// Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.
Expand Down
4 changes: 2 additions & 2 deletions github/secret_scanning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func TestSecretScanningService_UpdateAlert(t *testing.T) {
v := new(SecretScanningAlertUpdateOptions)
assertNilError(t, json.NewDecoder(r.Body).Decode(v))

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

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

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

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

0 comments on commit 93bbca3

Please sign in to comment.