Repository: google/go-github
Pull request #2930 (2023-09-15 14:17:55)

Add missing secret scanning alert fields
Closes https://github.com/google/go-github/issues/2929

- [x] go generate
- [x] go vet
- [x] go test

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/google/go-github/pull/2930?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#2930](https://app.codecov.io/gh/google/go-github/pull/2930?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (6e2589e) into [master](https://app.codecov.io/gh/google/go-github/commit/fd33b81221685302178ba197dbabe71326ca9051?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (fd33b81) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##           master    #2930   +/-   ##
=======================================
  Coverage   98.17%   98.17%           
=======================================
  Files         143      143           
  Lines       12609    12609           
=======================================
  Hits        12379    12379           
  Misses        156      156           
  Partials       74       74           
```


| [Files Changed](https://app.codecov.io/gh/google/go-github/pull/2930?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | |
|---|---|---|
| [github/secret\_scanning.go](https://app.codecov.io/gh/google/go-github/pull/2930?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL3NlY3JldF9zY2FubmluZy5nbw==) | `100.00% <ø> (ø)` | |



Patch:
diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml
index 4f3cdf8e..4bc27ab6 100644
--- a/.github/workflows/linter.yml
+++ b/.github/workflows/linter.yml
@@ -29,4 +29,4 @@ jobs:
       with:
         version: latest
         working-directory: ${{ matrix.working-directory}}
-        args: --verbose
+        args: --verbose --timeout=10m
diff --git a/github/github-accessors.go b/github/github-accessors.go
index a685a3ef..e7cfa86f 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -20694,6 +20694,30 @@ func (s *SecretScanningAlert) GetNumber() int {
 	return *s.Number
 }
 
+// GetPushProtectionBypassed returns the PushProtectionBypassed field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetPushProtectionBypassed() bool {
+	if s == nil || s.PushProtectionBypassed == nil {
+		return false
+	}
+	return *s.PushProtectionBypassed
+}
+
+// GetPushProtectionBypassedAt returns the PushProtectionBypassedAt field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetPushProtectionBypassedAt() Timestamp {
+	if s == nil || s.PushProtectionBypassedAt == nil {
+		return Timestamp{}
+	}
+	return *s.PushProtectionBypassedAt
+}
+
+// GetPushProtectionBypassedBy returns the PushProtectionBypassedBy field.
+func (s *SecretScanningAlert) GetPushProtectionBypassedBy() *User {
+	if s == nil {
+		return nil
+	}
+	return s.PushProtectionBypassedBy
+}
+
 // GetRepository returns the Repository field.
 func (s *SecretScanningAlert) GetRepository() *Repository {
 	if s == nil {
@@ -20710,6 +20734,14 @@ func (s *SecretScanningAlert) GetResolution() string {
 	return *s.Resolution
 }
 
+// GetResolutionComment returns the ResolutionComment field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetResolutionComment() string {
+	if s == nil || s.ResolutionComment == nil {
+		return ""
+	}
+	return *s.ResolutionComment
+}
+
 // GetResolvedAt returns the ResolvedAt field if it's non-nil, zero value otherwise.
 func (s *SecretScanningAlert) GetResolvedAt() Timestamp {
 	if s == nil || s.ResolvedAt == nil {
@@ -20758,6 +20790,14 @@ func (s *SecretScanningAlert) GetState() string {
 	return *s.State
 }
 
+// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlert) GetUpdatedAt() Timestamp {
+	if s == nil || s.UpdatedAt == nil {
+		return Timestamp{}
+	}
+	return *s.UpdatedAt
+}
+
 // GetURL returns the URL field if it's non-nil, zero value otherwise.
 func (s *SecretScanningAlert) GetURL() string {
 	if s == nil || s.URL == nil {
@@ -21166,14 +21206,6 @@ func (s *SelectedReposList) GetTotalCount() int {
 	return *s.TotalCount
 }
 
-// GetName returns the Name field if it's non-nil, zero value otherwise.
-func (s *ServiceHook) GetName() string {
-	if s == nil || s.Name == nil {
-		return ""
-	}
-	return *s.Name
-}
-
 // GetFrom returns the From field if it's non-nil, zero value otherwise.
 func (s *SignatureRequirementEnforcementLevelChanges) GetFrom() string {
 	if s == nil || s.From == nil {
diff --git a/github/github.go b/github/github.go
index e16bb084..e9ce136b 100644
--- a/github/github.go
+++ b/github/github.go
@@ -462,7 +462,7 @@ func NewTokenClient(_ context.Context, token string) *Client {
 // NewEnterpriseClient returns a new GitHub API client with provided
 // base URL and upload URL (often is your GitHub Enterprise hostname).
 //
-// Deprecated: Use NewClient(httpClient).WithOptions(WithEnterpriseURLs(baseURL, uploadURL)) instead.
+// Deprecated: Use NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL) instead.
 func NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*Client, error) {
 	return NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL)
 }
diff --git a/github/misc.go b/github/misc.go
index 89615241..a01b716f 100644
--- a/github/misc.go
+++ b/github/misc.go
@@ -245,35 +245,3 @@ func (c *Client) Zen(ctx context.Context) (string, *Response, error) {
 
 	return buf.String(), resp, nil
 }
-
-// ServiceHook represents a hook that has configuration settings, a list of
-// available events, and default events.
-type ServiceHook struct {
-	Name            *string    `json:"name,omitempty"`
-	Events          []string   `json:"events,omitempty"`
-	SupportedEvents []string   `json:"supported_events,omitempty"`
-	Schema          [][]string `json:"schema,omitempty"`
-}
-
-func (s *ServiceHook) String() string {
-	return Stringify(s)
-}
-
-// ListServiceHooks lists all of the available service hooks.
-//
-// GitHub API docs: https://developer.github.com/webhooks/#services
-func (c *Client) ListServiceHooks(ctx context.Context) ([]*ServiceHook, *Response, error) {
-	u := "hooks"
-	req, err := c.NewRequest("GET", u, nil)
-	if err != nil {
-		return nil, nil, err
-	}
-
-	var hooks []*ServiceHook
-	resp, err := c.Do(ctx, req, &hooks)
-	if err != nil {
-		return nil, resp, err
-	}
-
-	return hooks, resp, nil
-}
diff --git a/github/repos_contents.go b/github/repos_contents.go
index de7a0d5b..d59c735d 100644
--- a/github/repos_contents.go
+++ b/github/repos_contents.go
@@ -91,6 +91,8 @@ func (r *RepositoryContent) GetContent() (string, error) {
 			return "", nil
 		}
 		return *r.Content, nil
+	case "none":
+		return "", errors.New("unsupported content encoding: none, this may occur when file size > 1 MB, if that is the case consider using DownloadContents")
 	default:
 		return "", fmt.Errorf("unsupported content encoding: %v", encoding)
 	}
diff --git a/github/secret_scanning.go b/github/secret_scanning.go
index b8295cbf..bea3f0e7 100644
--- a/github/secret_scanning.go
+++ b/github/secret_scanning.go
@@ -16,19 +16,24 @@ 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"`
-	SecretTypeDisplayName *string     `json:"secret_type_display_name,omitempty"`
-	Secret                *string     `json:"secret,omitempty"`
-	Repository            *Repository `json:"repository,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"`
+	SecretTypeDisplayName    *string     `json:"secret_type_display_name,omitempty"`
+	Secret                   *string     `json:"secret,omitempty"`
+	Repository               *Repository `json:"repository,omitempty"`
+	UpdatedAt                *Timestamp  `json:"updated_at,omitempty"`
+	PushProtectionBypassed   *bool       `json:"push_protection_bypassed,omitempty"`
+	PushProtectionBypassedBy *User       `json:"push_protection_bypassed_by,omitempty"`
+	PushProtectionBypassedAt *Timestamp  `json:"push_protection_bypassed_at,omitempty"`
+	ResolutionComment        *string     `json:"resolution_comment,omitempty"`
 }
 
 // SecretScanningAlertLocation represents the location for a secret scanning alert.
diff --git a/scrape/go.mod b/scrape/go.mod
index 8c611636..9b70258f 100644
--- a/scrape/go.mod
+++ b/scrape/go.mod
@@ -7,5 +7,5 @@ require (
 	github.com/google/go-cmp v0.5.9
 	github.com/google/go-github/v55 v55.0.0
 	github.com/xlzd/gotp v0.1.0
-	golang.org/x/net v0.14.0
+	golang.org/x/net v0.15.0
 )
diff --git a/scrape/go.sum b/scrape/go.sum
index 7a797279..7db3e441 100644
--- a/scrape/go.sum
+++ b/scrape/go.sum
@@ -22,8 +22,9 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
-golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
 golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
+golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
+golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -34,8 +35,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
 golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
-golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
-golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
+golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
+golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -50,14 +51,16 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
 golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
+golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
 golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
 golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
 golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
+golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -66,6 +69,7 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index 10ef017b..e2918bea 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -24140,6 +24140,33 @@ func TestSecretScanningAlert_GetNumber(tt *testing.T) {
 	s.GetNumber()
 }
 
+func TestSecretScanningAlert_GetPushProtectionBypassed(tt *testing.T) {
+	var zeroValue bool
+	s := &SecretScanningAlert{PushProtectionBypassed: &zeroValue}
+	s.GetPushProtectionBypassed()
+	s = &SecretScanningAlert{}
+	s.GetPushProtectionBypassed()
+	s = nil
+	s.GetPushProtectionBypassed()
+}
+
+func TestSecretScanningAlert_GetPushProtectionBypassedAt(tt *testing.T) {
+	var zeroValue Timestamp
+	s := &SecretScanningAlert{PushProtectionBypassedAt: &zeroValue}
+	s.GetPushProtectionBypassedAt()
+	s = &SecretScanningAlert{}
+	s.GetPushProtectionBypassedAt()
+	s = nil
+	s.GetPushProtectionBypassedAt()
+}
+
+func TestSecretScanningAlert_GetPushProtectionBypassedBy(tt *testing.T) {
+	s := &SecretScanningAlert{}
+	s.GetPushProtectionBypassedBy()
+	s = nil
+	s.GetPushProtectionBypassedBy()
+}
+
 func TestSecretScanningAlert_GetRepository(tt *testing.T) {
 	s := &SecretScanningAlert{}
 	s.GetRepository()
@@ -24157,6 +24184,16 @@ func TestSecretScanningAlert_GetResolution(tt *testing.T) {
 	s.GetResolution()
 }
 
+func TestSecretScanningAlert_GetResolutionComment(tt *testing.T) {
+	var zeroValue string
+	s := &SecretScanningAlert{ResolutionComment: &zeroValue}
+	s.GetResolutionComment()
+	s = &SecretScanningAlert{}
+	s.GetResolutionComment()
+	s = nil
+	s.GetResolutionComment()
+}
+
 func TestSecretScanningAlert_GetResolvedAt(tt *testing.T) {
 	var zeroValue Timestamp
 	s := &SecretScanningAlert{ResolvedAt: &zeroValue}
@@ -24214,6 +24251,16 @@ func TestSecretScanningAlert_GetState(tt *testing.T) {
 	s.GetState()
 }
 
+func TestSecretScanningAlert_GetUpdatedAt(tt *testing.T) {
+	var zeroValue Timestamp
+	s := &SecretScanningAlert{UpdatedAt: &zeroValue}
+	s.GetUpdatedAt()
+	s = &SecretScanningAlert{}
+	s.GetUpdatedAt()
+	s = nil
+	s.GetUpdatedAt()
+}
+
 func TestSecretScanningAlert_GetURL(tt *testing.T) {
 	var zeroValue string
 	s := &SecretScanningAlert{URL: &zeroValue}
@@ -24646,16 +24693,6 @@ func TestSelectedReposList_GetTotalCount(tt *testing.T) {
 	s.GetTotalCount()
 }
 
-func TestServiceHook_GetName(tt *testing.T) {
-	var zeroValue string
-	s := &ServiceHook{Name: &zeroValue}
-	s.GetName()
-	s = &ServiceHook{}
-	s.GetName()
-	s = nil
-	s.GetName()
-}
-
 func TestSignatureRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) {
 	var zeroValue string
 	s := &SignatureRequirementEnforcementLevelChanges{From: &zeroValue}
diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go
index 1d2a47bb..c14412c2 100644
--- a/github/github-stringify_test.go
+++ b/github/github-stringify_test.go
@@ -1820,18 +1820,6 @@ func TestSecurityAndAnalysis_String(t *testing.T) {
 	}
 }
 
-func TestServiceHook_String(t *testing.T) {
-	v := ServiceHook{
-		Name:            String(""),
-		Events:          []string{""},
-		SupportedEvents: []string{""},
-	}
-	want := `github.ServiceHook{Name:"", Events:[""], SupportedEvents:[""]}`
-	if got := v.String(); got != want {
-		t.Errorf("ServiceHook.String = %v, want %v", got, want)
-	}
-}
-
 func TestSourceImportAuthor_String(t *testing.T) {
 	v := SourceImportAuthor{
 		ID:         Int64(0),
diff --git a/github/misc_test.go b/github/misc_test.go
index 69427ebf..45c99893 100644
--- a/github/misc_test.go
+++ b/github/misc_test.go
@@ -317,48 +317,6 @@ func TestZen(t *testing.T) {
 	})
 }
 
-func TestListServiceHooks(t *testing.T) {
-	client, mux, _, teardown := setup()
-	defer teardown()
-
-	mux.HandleFunc("/hooks", func(w http.ResponseWriter, r *http.Request) {
-		testMethod(t, r, "GET")
-		fmt.Fprint(w, `[{
-			"name":"n",
-			"events":["e"],
-			"supported_events":["s"],
-			"schema":[
-			  ["a", "b"]
-			]
-		}]`)
-	})
-
-	ctx := context.Background()
-	hooks, _, err := client.ListServiceHooks(ctx)
-	if err != nil {
-		t.Errorf("ListServiceHooks returned error: %v", err)
-	}
-
-	want := []*ServiceHook{{
-		Name:            String("n"),
-		Events:          []string{"e"},
-		SupportedEvents: []string{"s"},
-		Schema:          [][]string{{"a", "b"}},
-	}}
-	if !cmp.Equal(hooks, want) {
-		t.Errorf("ListServiceHooks returned %+v, want %+v", hooks, want)
-	}
-
-	const methodName = "ListServiceHooks"
-	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
-		got, resp, err := client.ListServiceHooks(ctx)
-		if got != nil {
-			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
-		}
-		return resp, err
-	})
-}
-
 func TestMarkdownRequest_Marshal(t *testing.T) {
 	testJSONMarshal(t, &markdownRequest{}, "{}")
 
@@ -396,30 +354,3 @@ func TestCodeOfConduct_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, a, want)
 }
-
-func TestServiceHook_Marshal(t *testing.T) {
-	testJSONMarshal(t, &ServiceHook{}, "{}")
-
-	a := &ServiceHook{
-		Name:            String("name"),
-		Events:          []string{"e"},
-		SupportedEvents: []string{"se"},
-		Schema:          [][]string{{"g"}},
-	}
-	want := `{
-		"name": "name",
-		"events": [
-			"e"
-		],
-		"supported_events": [
-			"se"
-		],
-		"schema": [
-			[
-				"g"
-			]
-		]
-	}`
-
-	testJSONMarshal(t, a, want)
-}
diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go
index ab69b5cd..f9613069 100644
--- a/github/repos_contents_test.go
+++ b/github/repos_contents_test.go
@@ -54,6 +54,12 @@ func TestRepositoryContent_GetContent(t *testing.T) {
 			want:     "",
 			wantErr:  true,
 		},
+		{
+			encoding: String("none"),
+			content:  nil,
+			want:     "",
+			wantErr:  true,
+		},
 	}
 
 	for _, tt := range tests {
diff --git a/test/integration/misc_test.go b/test/integration/misc_test.go
index 60753ada..e0cee29b 100644
--- a/test/integration/misc_test.go
+++ b/test/integration/misc_test.go
@@ -67,14 +67,3 @@ func TestRateLimits(t *testing.T) {
 		t.Errorf("Core.Reset is more than 1 minute in the past; that doesn't seem right.")
 	}
 }
-
-func TestListServiceHooks(t *testing.T) {
-	hooks, _, err := client.ListServiceHooks(context.Background())
-	if err != nil {
-		t.Fatalf("ListServiceHooks returned error: %v", err)
-	}
-
-	if len(hooks) == 0 {
-		t.Fatalf("ListServiceHooks returned no hooks")
-	}
-}