Repository: google/go-github
Pull request #2154 (2021-10-27 18:28:52)

Parse Before/After Links into Response
* Some Github APIs use `before`/`after` for pagination, rather than `page` or `cursor` pagination. Parse these response values into the github `Response`
* For example, the Organizations GetAuditLog (Enterprise Cloud) https://docs.github.com/en/rest/reference/orgs#get-the-audit-log-for-an-organization

With this change, pagination can be performed

```go
auditParams := &github.GetAuditLogOptions{}
for {
  entries, resp, err := client.Organizations.GetAuditLog(ctx, "myorg", auditParams)
  if err != nil {
    return err
  }

  if resp.After == "" {
    break
  }
  auditParams.After = resp.After
}
```

Rel: https://github.com/google/go-github/issues/1848


Patch:
diff --git a/README.md b/README.md
index 0028cdc2..3e893a69 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 # go-github #
 
 [![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases)
-[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v39/github)
+[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v40/github)
 [![Test Status](https://github.com/google/go-github/workflows/tests/badge.svg)](https://github.com/google/go-github/actions?query=workflow%3Atests)
 [![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github)
 [![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github)
@@ -24,7 +24,7 @@ If you're interested in using the [GraphQL API v4][], the recommended library is
 go-github is compatible with modern Go releases in module mode, with Go installed:
 
 ```bash
-go get github.com/google/go-github/v39
+go get github.com/google/go-github/v40
 ```
 
 will resolve and add the package to the current development module, along with its dependencies.
@@ -32,7 +32,7 @@ will resolve and add the package to the current development module, along with i
 Alternatively the same can be achieved if you use import in a package:
 
 ```go
-import "github.com/google/go-github/v39/github"
+import "github.com/google/go-github/v40/github"
 ```
 
 and run `go get` without parameters.
@@ -40,13 +40,13 @@ and run `go get` without parameters.
 Finally, to use the top-of-trunk version of this repo, use the following command:
 
 ```bash
-go get github.com/google/go-github/v39@master
+go get github.com/google/go-github/v40@master
 ```
 
 ## Usage ##
 
 ```go
-import "github.com/google/go-github/v39/github"	// with go modules enabled (GO111MODULE=on or outside GOPATH)
+import "github.com/google/go-github/v40/github"	// with go modules enabled (GO111MODULE=on or outside GOPATH)
 import "github.com/google/go-github/github" // with go modules disabled
 ```
 
@@ -246,7 +246,7 @@ For complete usage of go-github, see the full [package docs][].
 [oauth2]: https://github.com/golang/oauth2
 [oauth2 docs]: https://godoc.org/golang.org/x/oauth2
 [personal API token]: https://github.com/blog/1509-personal-api-tokens
-[package docs]: https://pkg.go.dev/github.com/google/go-github/v39/github
+[package docs]: https://pkg.go.dev/github.com/google/go-github/v40/github
 [GraphQL API v4]: https://developer.github.com/v4/
 [shurcooL/githubv4]: https://github.com/shurcooL/githubv4
 
diff --git a/example/appengine/app.go b/example/appengine/app.go
index c50439ef..1415f0af 100644
--- a/example/appengine/app.go
+++ b/example/appengine/app.go
@@ -12,7 +12,7 @@ import (
 	"net/http"
 	"os"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/oauth2"
 	"google.golang.org/appengine"
 	"google.golang.org/appengine/log"
diff --git a/example/basicauth/main.go b/example/basicauth/main.go
index 994b5315..8ad613f0 100644
--- a/example/basicauth/main.go
+++ b/example/basicauth/main.go
@@ -22,7 +22,7 @@ import (
 	"strings"
 	"syscall"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/crypto/ssh/terminal"
 )
 
diff --git a/example/commitpr/main.go b/example/commitpr/main.go
index f437c84d..c82a05dd 100644
--- a/example/commitpr/main.go
+++ b/example/commitpr/main.go
@@ -31,7 +31,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/oauth2"
 )
 
diff --git a/example/migrations/main.go b/example/migrations/main.go
index 2bd3db17..3f37b2ba 100644
--- a/example/migrations/main.go
+++ b/example/migrations/main.go
@@ -12,7 +12,7 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/oauth2"
 )
 
diff --git a/example/newrepo/main.go b/example/newrepo/main.go
index 949a85f9..cad89fac 100644
--- a/example/newrepo/main.go
+++ b/example/newrepo/main.go
@@ -16,7 +16,7 @@ import (
 	"log"
 	"os"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/oauth2"
 )
 
diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod
index 972d2314..dc2a6ede 100644
--- a/example/newreposecretwithlibsodium/go.mod
+++ b/example/newreposecretwithlibsodium/go.mod
@@ -4,7 +4,6 @@ go 1.15
 
 require (
 	github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb
-	github.com/google/go-github/v39 v39.0.0
+	github.com/google/go-github/v40 v40.0.0
 	golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
-	gopkg.in/yaml.v2 v2.3.0 // indirect
 )
diff --git a/example/newreposecretwithlibsodium/go.sum b/example/newreposecretwithlibsodium/go.sum
index 1fbdb111..64499908 100644
--- a/example/newreposecretwithlibsodium/go.sum
+++ b/example/newreposecretwithlibsodium/go.sum
@@ -72,6 +72,7 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
 github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
 github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
 github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -82,13 +83,13 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
 github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
 github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-github/v33 v33.0.0 h1:qAf9yP0qc54ufQxzwv+u9H0tiVOnPJxo0lI/JXqw3ZM=
-github.com/google/go-github/v33 v33.0.0/go.mod h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg=
-github.com/google/go-github/v39 v39.0.0 h1:rCspN8/6kB1BAJWZfuafvHhyfIo5fkAulaP/3bOQ/tM=
-github.com/google/go-github/v39 v39.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4=
-github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
-github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
+github.com/google/go-github/v40 v40.0.0 h1:oBPVDaIhdUmwDWRRH8XJ/dZG+Rn755i08+Hp1uJHlR0=
+github.com/google/go-github/v40 v40.0.0/go.mod h1:G8wWKTEjUCL0zdbaQvpwDk0hqf6KZgPQH+ssJa+/NVc=
+github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
+github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
 github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
 github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
 github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
@@ -127,8 +128,9 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
 golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
+golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -184,8 +186,9 @@ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/
 golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
 golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -226,6 +229,9 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -277,6 +283,7 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
 google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
@@ -300,6 +307,8 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
 google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
+google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
 google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
@@ -350,12 +359,12 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
+google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
 google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go
index 40e66851..080950d7 100644
--- a/example/newreposecretwithlibsodium/main.go
+++ b/example/newreposecretwithlibsodium/main.go
@@ -34,7 +34,7 @@ import (
 	"os"
 
 	sodium "github.com/GoKillers/libsodium-go/cryptobox"
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/oauth2"
 )
 
diff --git a/example/newreposecretwithxcrypto/go.mod b/example/newreposecretwithxcrypto/go.mod
index 472389c8..c11c2fd7 100644
--- a/example/newreposecretwithxcrypto/go.mod
+++ b/example/newreposecretwithxcrypto/go.mod
@@ -3,8 +3,8 @@ module newreposecretwithxcrypto
 go 1.15
 
 require (
-	github.com/google/go-github/v39 v39.0.0
-	golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
+	github.com/google/go-github/v40 v40.0.0
+	golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
 	golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
 	golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
 	golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect
diff --git a/example/newreposecretwithxcrypto/go.sum b/example/newreposecretwithxcrypto/go.sum
index ad230c75..8ad570a3 100644
--- a/example/newreposecretwithxcrypto/go.sum
+++ b/example/newreposecretwithxcrypto/go.sum
@@ -81,12 +81,13 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
 github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
 github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-github/v39 v39.0.0 h1:rCspN8/6kB1BAJWZfuafvHhyfIo5fkAulaP/3bOQ/tM=
-github.com/google/go-github/v39 v39.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4=
-github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
-github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
+github.com/google/go-github/v40 v40.0.0 h1:oBPVDaIhdUmwDWRRH8XJ/dZG+Rn755i08+Hp1uJHlR0=
+github.com/google/go-github/v40 v40.0.0/go.mod h1:G8wWKTEjUCL0zdbaQvpwDk0hqf6KZgPQH+ssJa+/NVc=
+github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
+github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
 github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
 github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
 github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
@@ -126,8 +127,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
 golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI=
-golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
+golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -308,8 +309,9 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
 google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
 google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
+google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
 google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go
index 294e8d47..88b52ff4 100644
--- a/example/newreposecretwithxcrypto/main.go
+++ b/example/newreposecretwithxcrypto/main.go
@@ -34,7 +34,7 @@ import (
 	"log"
 	"os"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/crypto/nacl/box"
 	"golang.org/x/oauth2"
 )
diff --git a/example/simple/main.go b/example/simple/main.go
index 4db568e0..22658961 100644
--- a/example/simple/main.go
+++ b/example/simple/main.go
@@ -12,7 +12,7 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 )
 
 // Fetch all the public organizations' membership of a user.
diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go
index 8fb3ebb4..375a8ea1 100644
--- a/example/tokenauth/main.go
+++ b/example/tokenauth/main.go
@@ -14,7 +14,7 @@ import (
 	"log"
 	"syscall"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/crypto/ssh/terminal"
 	"golang.org/x/oauth2"
 )
diff --git a/example/topics/main.go b/example/topics/main.go
index b35bd9e8..6c5948de 100644
--- a/example/topics/main.go
+++ b/example/topics/main.go
@@ -12,7 +12,7 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 )
 
 // Fetch and lists all the public topics associated with the specified GitHub topic
diff --git a/github/billing.go b/github/billing.go
index fa0e034d..190140a4 100644
--- a/github/billing.go
+++ b/github/billing.go
@@ -39,9 +39,9 @@ type PackageBilling struct {
 
 // StorageBilling represents a GitHub Storage billing.
 type StorageBilling struct {
-	DaysLeftInBillingCycle       int `json:"days_left_in_billing_cycle"`
-	EstimatedPaidStorageForMonth int `json:"estimated_paid_storage_for_month"`
-	EstimatedStorageForMonth     int `json:"estimated_storage_for_month"`
+	DaysLeftInBillingCycle       int     `json:"days_left_in_billing_cycle"`
+	EstimatedPaidStorageForMonth float64 `json:"estimated_paid_storage_for_month"`
+	EstimatedStorageForMonth     int     `json:"estimated_storage_for_month"`
 }
 
 // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org.
diff --git a/github/code-scanning.go b/github/code-scanning.go
index 50264a0c..4508c339 100644
--- a/github/code-scanning.go
+++ b/github/code-scanning.go
@@ -119,6 +119,26 @@ type AlertListOptions struct {
 	ListOptions
 }
 
+// SarifAnalysis specifies the results of a code scanning job.
+//
+// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data
+type SarifAnalysis struct {
+	CommitSHA   *string    `json:"commit_sha,omitempty"`
+	Ref         *string    `json:"ref,omitempty"`
+	Sarif       *string    `json:"sarif,omitempty"`
+	CheckoutURI *string    `json:"checkout_uri,omitempty"`
+	StartedAt   *Timestamp `json:"started_at,omitempty"`
+	ToolName    *string    `json:"tool_name,omitempty"`
+}
+
+// SarifID identifies a sarif analysis upload.
+//
+// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data
+type SarifID struct {
+	ID  *string `json:"id,omitempty"`
+	URL *string `json:"url,omitempty"`
+}
+
 // ListAlertsForRepo lists code scanning alerts for a repository.
 //
 // Lists all open code scanning alerts for the default branch (usually master) and protected branches in a repository.
@@ -171,3 +191,27 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string,
 
 	return a, resp, nil
 }
+
+// UploadSarif uploads the result of code scanning job to GitHub.
+//
+// For the parameter sarif, you must first compress your SARIF file using gzip and then translate the contents of the file into a Base64 encoding string.
+// You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events
+// write permission to use this endpoint.
+//
+// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data
+func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo)
+
+	req, err := s.client.NewRequest("POST", u, sarif)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	sarifID := new(SarifID)
+	resp, err := s.client.Do(ctx, req, sarifID)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return sarifID, resp, nil
+}
diff --git a/github/doc.go b/github/doc.go
index 87eda1de..845d3062 100644
--- a/github/doc.go
+++ b/github/doc.go
@@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API.
 
 Usage:
 
-	import "github.com/google/go-github/v39/github"	// with go modules enabled (GO111MODULE=on or outside GOPATH)
+	import "github.com/google/go-github/v40/github"	// with go modules enabled (GO111MODULE=on or outside GOPATH)
 	import "github.com/google/go-github/github"     // with go modules disabled
 
 Construct a new GitHub client, then use the various services on the client to
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 1d2db4ec..b2c53f36 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -15148,6 +15148,70 @@ func (r *RunnerLabels) GetType() string {
 	return *r.Type
 }
 
+// GetCheckoutURI returns the CheckoutURI field if it's non-nil, zero value otherwise.
+func (s *SarifAnalysis) GetCheckoutURI() string {
+	if s == nil || s.CheckoutURI == nil {
+		return ""
+	}
+	return *s.CheckoutURI
+}
+
+// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise.
+func (s *SarifAnalysis) GetCommitSHA() string {
+	if s == nil || s.CommitSHA == nil {
+		return ""
+	}
+	return *s.CommitSHA
+}
+
+// GetRef returns the Ref field if it's non-nil, zero value otherwise.
+func (s *SarifAnalysis) GetRef() string {
+	if s == nil || s.Ref == nil {
+		return ""
+	}
+	return *s.Ref
+}
+
+// GetSarif returns the Sarif field if it's non-nil, zero value otherwise.
+func (s *SarifAnalysis) GetSarif() string {
+	if s == nil || s.Sarif == nil {
+		return ""
+	}
+	return *s.Sarif
+}
+
+// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.
+func (s *SarifAnalysis) GetStartedAt() Timestamp {
+	if s == nil || s.StartedAt == nil {
+		return Timestamp{}
+	}
+	return *s.StartedAt
+}
+
+// GetToolName returns the ToolName field if it's non-nil, zero value otherwise.
+func (s *SarifAnalysis) GetToolName() string {
+	if s == nil || s.ToolName == nil {
+		return ""
+	}
+	return *s.ToolName
+}
+
+// GetID returns the ID field if it's non-nil, zero value otherwise.
+func (s *SarifID) GetID() string {
+	if s == nil || s.ID == nil {
+		return ""
+	}
+	return *s.ID
+}
+
+// GetURL returns the URL field if it's non-nil, zero value otherwise.
+func (s *SarifID) GetURL() string {
+	if s == nil || s.URL == nil {
+		return ""
+	}
+	return *s.URL
+}
+
 // GetActive returns the Active field if it's non-nil, zero value otherwise.
 func (s *SCIMUserAttributes) GetActive() bool {
 	if s == nil || s.Active == nil {
@@ -16372,6 +16436,30 @@ func (t *Timeline) GetAssignee() *User {
 	return t.Assignee
 }
 
+// GetAssigner returns the Assigner field.
+func (t *Timeline) GetAssigner() *User {
+	if t == nil {
+		return nil
+	}
+	return t.Assigner
+}
+
+// GetAuthor returns the Author field.
+func (t *Timeline) GetAuthor() *CommitAuthor {
+	if t == nil {
+		return nil
+	}
+	return t.Author
+}
+
+// GetBody returns the Body field if it's non-nil, zero value otherwise.
+func (t *Timeline) GetBody() string {
+	if t == nil || t.Body == nil {
+		return ""
+	}
+	return *t.Body
+}
+
 // GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.
 func (t *Timeline) GetCommitID() string {
 	if t == nil || t.CommitID == nil {
@@ -16380,6 +16468,14 @@ func (t *Timeline) GetCommitID() string {
 	return *t.CommitID
 }
 
+// GetCommitter returns the Committer field.
+func (t *Timeline) GetCommitter() *CommitAuthor {
+	if t == nil {
+		return nil
+	}
+	return t.Committer
+}
+
 // GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise.
 func (t *Timeline) GetCommitURL() string {
 	if t == nil || t.CommitURL == nil {
@@ -16420,6 +16516,14 @@ func (t *Timeline) GetLabel() *Label {
 	return t.Label
 }
 
+// GetMessage returns the Message field if it's non-nil, zero value otherwise.
+func (t *Timeline) GetMessage() string {
+	if t == nil || t.Message == nil {
+		return ""
+	}
+	return *t.Message
+}
+
 // GetMilestone returns the Milestone field.
 func (t *Timeline) GetMilestone() *Milestone {
 	if t == nil {
@@ -16444,6 +16548,30 @@ func (t *Timeline) GetRename() *Rename {
 	return t.Rename
 }
 
+// GetRequester returns the Requester field.
+func (t *Timeline) GetRequester() *User {
+	if t == nil {
+		return nil
+	}
+	return t.Requester
+}
+
+// GetReviewer returns the Reviewer field.
+func (t *Timeline) GetReviewer() *User {
+	if t == nil {
+		return nil
+	}
+	return t.Reviewer
+}
+
+// GetSHA returns the SHA field if it's non-nil, zero value otherwise.
+func (t *Timeline) GetSHA() string {
+	if t == nil || t.SHA == nil {
+		return ""
+	}
+	return *t.SHA
+}
+
 // GetSource returns the Source field.
 func (t *Timeline) GetSource() *Source {
 	if t == nil {
@@ -16460,6 +16588,14 @@ func (t *Timeline) GetState() string {
 	return *t.State
 }
 
+// GetSubmittedAt returns the SubmittedAt field if it's non-nil, zero value otherwise.
+func (t *Timeline) GetSubmittedAt() time.Time {
+	if t == nil || t.SubmittedAt == nil {
+		return time.Time{}
+	}
+	return *t.SubmittedAt
+}
+
 // GetURL returns the URL field if it's non-nil, zero value otherwise.
 func (t *Timeline) GetURL() string {
 	if t == nil || t.URL == nil {
@@ -16468,6 +16604,14 @@ func (t *Timeline) GetURL() string {
 	return *t.URL
 }
 
+// GetUser returns the User field.
+func (t *Timeline) GetUser() *User {
+	if t == nil {
+		return nil
+	}
+	return t.User
+}
+
 // GetGUID returns the GUID field if it's non-nil, zero value otherwise.
 func (t *Tool) GetGUID() string {
 	if t == nil || t.GUID == nil {
diff --git a/github/github.go b/github/github.go
index d4d7a54a..56f1be89 100644
--- a/github/github.go
+++ b/github/github.go
@@ -48,6 +48,21 @@ const (
 	mediaTypeIssueImportAPI    = "application/vnd.github.golden-comet-preview+json"
 
 	// Media Type values to access preview APIs
+	// These media types will be added to the API request as headers
+	// and used to enable particular features on GitHub API that are still in preview.
+	// After some time, specific media types will be promoted (to a "stable" state).
+	// From then on, the preview headers are not required anymore to activate the additional
+	// feature on GitHub.com's API. However, this API header might still be needed for users
+	// to run a GitHub Enterprise Server on-premise.
+	// It's not uncommon for GitHub Enterprise Server customers to run older versions which
+	// would probably rely on the preview headers for some time.
+	// While the header promotion is going out for GitHub.com, it may be some time before it
+	// even arrives in GitHub Enterprise Server.
+	// We keep those preview headers around to avoid breaking older GitHub Enterprise Server
+	// versions. Additionally, non-functional (preview) headers don't create any side effects
+	// on GitHub Cloud version.
+	//
+	// See https://github.com/google/go-github/pull/2125 for full context.
 
 	// https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/
 	mediaTypeStarringPreview = "application/vnd.github.v3.star+json"
@@ -462,6 +477,10 @@ type Response struct {
 	// Set ListCursorOptions.Cursor to this value when calling the endpoint again.
 	Cursor string
 
+	// For APIs that support before/after pagination, such as OrganizationsService.AuditLog.
+	Before string
+	After  string
+
 	// Explicitly specify the Rate type so Rate's String() receiver doesn't
 	// propagate to Response.
 	Rate Rate
@@ -517,7 +536,9 @@ func (r *Response) populatePageValues() {
 			}
 
 			page := q.Get("page")
-			if page == "" {
+			before := q.Get("before")
+			after := q.Get("after")
+			if page == "" && before == "" && after == "" {
 				continue
 			}
 
@@ -527,8 +548,10 @@ func (r *Response) populatePageValues() {
 					if r.NextPage, err = strconv.Atoi(page); err != nil {
 						r.NextPageToken = page
 					}
+					r.After = after
 				case `rel="prev"`:
 					r.PrevPage, _ = strconv.Atoi(page)
+					r.Before = before
 				case `rel="first"`:
 					r.FirstPage, _ = strconv.Atoi(page)
 				case `rel="last"`:
diff --git a/github/issues.go b/github/issues.go
index 46aff295..f35f2b56 100644
--- a/github/issues.go
+++ b/github/issues.go
@@ -299,6 +299,29 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num
 	return i, resp, nil
 }
 
+// Remove a milestone from an issue.
+//
+// This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it.
+//
+// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#update-an-issue
+func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, issueNumber)
+	req, err := s.client.NewRequest("PATCH", u, &struct {
+		Milestone *Milestone `json:"milestone"`
+	}{})
+	if err != nil {
+		return nil, nil, err
+	}
+
+	i := new(Issue)
+	resp, err := s.client.Do(ctx, req, i)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return i, resp, nil
+}
+
 // LockIssueOptions specifies the optional parameters to the
 // IssuesService.Lock method.
 type LockIssueOptions struct {
diff --git a/github/issues_timeline.go b/github/issues_timeline.go
index 1fd13b12..845e3f76 100644
--- a/github/issues_timeline.go
+++ b/github/issues_timeline.go
@@ -15,7 +15,7 @@ import (
 // Timeline represents an event that occurred around an Issue or Pull Request.
 //
 // It is similar to an IssueEvent but may contain more information.
-// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/timeline/
+// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types
 type Timeline struct {
 	ID        *int64  `json:"id,omitempty"`
 	URL       *string `json:"url,omitempty"`
@@ -24,6 +24,18 @@ type Timeline struct {
 	// The User object that generated the event.
 	Actor *User `json:"actor,omitempty"`
 
+	// The person who commented on the issue.
+	User *User `json:"user,omitempty"`
+
+	// The person who authored the commit.
+	Author *CommitAuthor `json:"author,omitempty"`
+	// The person who committed the commit on behalf of the author.
+	Committer *CommitAuthor `json:"committer,omitempty"`
+	// The SHA of the commit in the pull request.
+	SHA *string `json:"sha,omitempty"`
+	// The commit message.
+	Message *string `json:"message,omitempty"`
+
 	// Event identifies the actual type of Event that occurred. Possible values
 	// are:
 	//
@@ -111,6 +123,8 @@ type Timeline struct {
 	// The User object which was assigned to (or unassigned from) this Issue or
 	// Pull Request. Only provided for 'assigned' and 'unassigned' events.
 	Assignee *User `json:"assignee,omitempty"`
+	Assigner *User `json:"assigner,omitempty"`
+
 	// The Milestone object including a 'title' attribute.
 	// Only provided for 'milestoned' and 'demilestoned' events.
 	Milestone *Milestone `json:"milestone,omitempty"`
@@ -125,6 +139,15 @@ type Timeline struct {
 	// 'changes_requested' or 'approved'.
 	// Only provided for 'reviewed' events.
 	State *string `json:"state,omitempty"`
+
+	// The person requested to review the pull request.
+	Reviewer *User `json:"requested_reviewer,omitempty"`
+	// The person who requested a review.
+	Requester *User `json:"review_requester,omitempty"`
+
+	// The review summary text.
+	Body        *string    `json:"body,omitempty"`
+	SubmittedAt *time.Time `json:"submitted_at,omitempty"`
 }
 
 // Source represents a reference's source.
diff --git a/github/reactions.go b/github/reactions.go
index 08387cb5..ecfcf2e9 100644
--- a/github/reactions.go
+++ b/github/reactions.go
@@ -492,3 +492,29 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res
 
 	return s.client.Do(ctx, req, nil)
 }
+
+// Create a reaction to a release.
+// Note that a response with a Status: 200 OK means that you already
+// added the reaction type to this release.
+// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes".
+//
+// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-release
+func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID)
+
+	body := &Reaction{Content: String(content)}
+	req, err := s.client.NewRequest("POST", u, body)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	req.Header.Set("Accept", mediaTypeReactionsPreview)
+
+	m := &Reaction{}
+	resp, err := s.client.Do(ctx, req, m)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return m, resp, nil
+}
diff --git a/github/repos.go b/github/repos.go
index 391f3139..45c46180 100644
--- a/github/repos.go
+++ b/github/repos.go
@@ -1073,6 +1073,34 @@ func (s *RepositoriesService) getBranchFromURL(ctx context.Context, u string, fo
 	return resp, err
 }
 
+// renameBranchRequest represents a request to rename a branch.
+type renameBranchRequest struct {
+	NewName string `json:"new_name"`
+}
+
+// RenameBranch renames a branch in a repository.
+//
+// To rename a non-default branch: Users must have push access. GitHub Apps must have the `contents:write` repository permission.
+// To rename the default branch: Users must have admin or owner permissions. GitHub Apps must have the `administration:write` repository permission.
+//
+// GitHub API docs: https://docs.github.com/en/rest/reference/repos#rename-a-branch
+func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, branch)
+	r := &renameBranchRequest{NewName: newName}
+	req, err := s.client.NewRequest("POST", u, r)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	b := new(Branch)
+	resp, err := s.client.Do(ctx, req, b)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return b, resp, nil
+}
+
 // GetBranchProtection gets the protection of a given branch.
 //
 // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-branch-protection
diff --git a/go.mod b/go.mod
index 09f21f45..9c6b43d0 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/google/go-github/v39
+module github.com/google/go-github/v40
 
 require (
 	github.com/golang/protobuf v1.3.2 // indirect
diff --git a/scrape/apps.go b/scrape/apps.go
index c9ba358b..30f704cb 100644
--- a/scrape/apps.go
+++ b/scrape/apps.go
@@ -17,7 +17,7 @@ import (
 	"strings"
 
 	"github.com/PuerkitoBio/goquery"
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 )
 
 // AppRestrictionsEnabled returns whether the specified organization has
diff --git a/scrape/go.mod b/scrape/go.mod
index 2bf7b812..0149b8f2 100644
--- a/scrape/go.mod
+++ b/scrape/go.mod
@@ -3,9 +3,9 @@ module github.com/google/go-github/scrape
 go 1.13
 
 require (
-	github.com/PuerkitoBio/goquery v1.7.1
+	github.com/PuerkitoBio/goquery v1.8.0
 	github.com/google/go-cmp v0.5.6
-	github.com/google/go-github/v39 v39.2.0
+	github.com/google/go-github/v40 v40.0.0
 	github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119
-	golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
+	golang.org/x/net v0.0.0-20210916014120-12bc252f5db8
 )
diff --git a/scrape/go.sum b/scrape/go.sum
index 89953874..7ccfd213 100644
--- a/scrape/go.sum
+++ b/scrape/go.sum
@@ -1,14 +1,14 @@
-github.com/PuerkitoBio/goquery v1.7.1 h1:oE+T06D+1T7LNrn91B4aERsRIeCLJ/oPSa6xB9FPnz4=
-github.com/PuerkitoBio/goquery v1.7.1/go.mod h1:XY0pP4kfraEmmV1O7Uf6XyjoslwsneBbgeDjLYuN8xY=
-github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=
-github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY=
+github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U=
+github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI=
+github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
+github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
 github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-github/v39 v39.2.0 h1:rNNM311XtPOz5rDdsJXAp2o8F67X9FnROXTvto3aSnQ=
-github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE=
+github.com/google/go-github/v40 v40.0.0 h1:oBPVDaIhdUmwDWRRH8XJ/dZG+Rn755i08+Hp1uJHlR0=
+github.com/google/go-github/v40 v40.0.0/go.mod h1:G8wWKTEjUCL0zdbaQvpwDk0hqf6KZgPQH+ssJa+/NVc=
 github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
 github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
 github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119 h1:YyPWX3jLOtYKulBR6AScGIs74lLrJcgeKRwcbAuQOG4=
@@ -16,12 +16,10 @@ github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119/go.mod h1:/nuTSlK+okRfR/
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c=
-golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk=
+golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=


Test patch:
diff --git a/github/billing_test.go b/github/billing_test.go
index 7d1c2a1d..2693e68a 100644
--- a/github/billing_test.go
+++ b/github/billing_test.go
@@ -120,7 +120,7 @@ func TestBillingService_GetStorageBillingOrg(t *testing.T) {
 		testMethod(t, r, "GET")
 		fmt.Fprint(w, `{
 				"days_left_in_billing_cycle": 20,
-				"estimated_paid_storage_for_month": 15,
+				"estimated_paid_storage_for_month": 15.25,
 				"estimated_storage_for_month": 40
 			}`)
 	})
@@ -133,7 +133,7 @@ func TestBillingService_GetStorageBillingOrg(t *testing.T) {
 
 	want := &StorageBilling{
 		DaysLeftInBillingCycle:       20,
-		EstimatedPaidStorageForMonth: 15,
+		EstimatedPaidStorageForMonth: 15.25,
 		EstimatedStorageForMonth:     40,
 	}
 	if !cmp.Equal(hook, want) {
@@ -262,7 +262,7 @@ func TestBillingService_GetStorageBillingUser(t *testing.T) {
 		testMethod(t, r, "GET")
 		fmt.Fprint(w, `{
 				"days_left_in_billing_cycle": 20,
-				"estimated_paid_storage_for_month": 15,
+				"estimated_paid_storage_for_month": 15.25,
 				"estimated_storage_for_month": 40
 			}`)
 	})
@@ -275,7 +275,7 @@ func TestBillingService_GetStorageBillingUser(t *testing.T) {
 
 	want := &StorageBilling{
 		DaysLeftInBillingCycle:       20,
-		EstimatedPaidStorageForMonth: 15,
+		EstimatedPaidStorageForMonth: 15.25,
 		EstimatedStorageForMonth:     40,
 	}
 	if !cmp.Equal(hook, want) {
diff --git a/github/code-scanning_test.go b/github/code-scanning_test.go
index 55c8fa74..e96d0a0d 100644
--- a/github/code-scanning_test.go
+++ b/github/code-scanning_test.go
@@ -7,6 +7,7 @@ package github
 
 import (
 	"context"
+	"encoding/json"
 	"fmt"
 	"net/http"
 	"testing"
@@ -53,6 +54,41 @@ func TestActionsService_Alert_ID(t *testing.T) {
 	}
 }
 
+func TestActionsService_UploadSarif(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/code-scanning/sarifs", func(w http.ResponseWriter, r *http.Request) {
+		v := new(SarifAnalysis)
+		json.NewDecoder(r.Body).Decode(v)
+		testMethod(t, r, "POST")
+		want := &SarifAnalysis{CommitSHA: String("abc"), Ref: String("ref/head/main"), Sarif: String("abc"), CheckoutURI: String("uri"), StartedAt: &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}, ToolName: String("codeql-cli")}
+		if !cmp.Equal(v, want) {
+			t.Errorf("Request body = %+v, want %+v", v, want)
+		}
+
+		fmt.Fprint(w, `{"commit_sha":"abc","ref":"ref/head/main","sarif":"abc"}`)
+	})
+
+	ctx := context.Background()
+	sarifAnalysis := &SarifAnalysis{CommitSHA: String("abc"), Ref: String("ref/head/main"), Sarif: String("abc"), CheckoutURI: String("uri"), StartedAt: &Timestamp{time.Date(2006, time.January, 02, 15, 04, 05, 0, time.UTC)}, ToolName: String("codeql-cli")}
+	_, _, err := client.CodeScanning.UploadSarif(ctx, "o", "r", sarifAnalysis)
+	if err != nil {
+		t.Errorf("CodeScanning.UploadSarif returned error: %v", err)
+	}
+
+	const methodName = "UploadSarif"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.CodeScanning.UploadSarif(ctx, "\n", "\n", sarifAnalysis)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		_, resp, err := client.CodeScanning.UploadSarif(ctx, "o", "r", sarifAnalysis)
+		return resp, err
+	})
+}
+
 func TestActionsService_ListAlertsForRepo(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
@@ -435,6 +471,34 @@ func TestLocation_Marshal(t *testing.T) {
 	testJSONMarshal(t, u, want)
 }
 
+func TestRule_Marshal(t *testing.T) {
+	testJSONMarshal(t, &Rule{}, "{}")
+
+	u := &Rule{
+		ID:                    String("1"),
+		Severity:              String("3"),
+		Description:           String("description"),
+		Name:                  String("first"),
+		SecuritySeverityLevel: String("2"),
+		FullDescription:       String("summary"),
+		Tags:                  []string{"tag1", "tag2"},
+		Help:                  String("Help Text"),
+	}
+
+	want := `{
+		"id":                      "1",
+		"severity":                "3",
+		"description":             "description",
+		"name":                    "first",
+		"security_severity_level": "2",
+		"full_description":        "summary",
+		"tags":                    ["tag1", "tag2"],
+		"help":                    "Help Text"
+	}`
+
+	testJSONMarshal(t, u, want)
+}
+
 func TestTool_Marshal(t *testing.T) {
 	testJSONMarshal(t, &Tool{}, "{}")
 
@@ -452,3 +516,17 @@ func TestTool_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, u, want)
 }
+
+func TestMessage_Marshal(t *testing.T) {
+	testJSONMarshal(t, &Message{}, "{}")
+
+	u := &Message{
+		Text: String("text"),
+	}
+
+	want := `{
+		"text": "text"
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/examples_test.go b/github/examples_test.go
index 2027096d..9cfba6fa 100644
--- a/github/examples_test.go
+++ b/github/examples_test.go
@@ -12,7 +12,7 @@ import (
 	"fmt"
 	"log"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 )
 
 func ExampleClient_Markdown() {
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index f6af9991..61b32451 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -17709,6 +17709,86 @@ func TestRunnerLabels_GetType(tt *testing.T) {
 	r.GetType()
 }
 
+func TestSarifAnalysis_GetCheckoutURI(tt *testing.T) {
+	var zeroValue string
+	s := &SarifAnalysis{CheckoutURI: &zeroValue}
+	s.GetCheckoutURI()
+	s = &SarifAnalysis{}
+	s.GetCheckoutURI()
+	s = nil
+	s.GetCheckoutURI()
+}
+
+func TestSarifAnalysis_GetCommitSHA(tt *testing.T) {
+	var zeroValue string
+	s := &SarifAnalysis{CommitSHA: &zeroValue}
+	s.GetCommitSHA()
+	s = &SarifAnalysis{}
+	s.GetCommitSHA()
+	s = nil
+	s.GetCommitSHA()
+}
+
+func TestSarifAnalysis_GetRef(tt *testing.T) {
+	var zeroValue string
+	s := &SarifAnalysis{Ref: &zeroValue}
+	s.GetRef()
+	s = &SarifAnalysis{}
+	s.GetRef()
+	s = nil
+	s.GetRef()
+}
+
+func TestSarifAnalysis_GetSarif(tt *testing.T) {
+	var zeroValue string
+	s := &SarifAnalysis{Sarif: &zeroValue}
+	s.GetSarif()
+	s = &SarifAnalysis{}
+	s.GetSarif()
+	s = nil
+	s.GetSarif()
+}
+
+func TestSarifAnalysis_GetStartedAt(tt *testing.T) {
+	var zeroValue Timestamp
+	s := &SarifAnalysis{StartedAt: &zeroValue}
+	s.GetStartedAt()
+	s = &SarifAnalysis{}
+	s.GetStartedAt()
+	s = nil
+	s.GetStartedAt()
+}
+
+func TestSarifAnalysis_GetToolName(tt *testing.T) {
+	var zeroValue string
+	s := &SarifAnalysis{ToolName: &zeroValue}
+	s.GetToolName()
+	s = &SarifAnalysis{}
+	s.GetToolName()
+	s = nil
+	s.GetToolName()
+}
+
+func TestSarifID_GetID(tt *testing.T) {
+	var zeroValue string
+	s := &SarifID{ID: &zeroValue}
+	s.GetID()
+	s = &SarifID{}
+	s.GetID()
+	s = nil
+	s.GetID()
+}
+
+func TestSarifID_GetURL(tt *testing.T) {
+	var zeroValue string
+	s := &SarifID{URL: &zeroValue}
+	s.GetURL()
+	s = &SarifID{}
+	s.GetURL()
+	s = nil
+	s.GetURL()
+}
+
 func TestSCIMUserAttributes_GetActive(tt *testing.T) {
 	var zeroValue bool
 	s := &SCIMUserAttributes{Active: &zeroValue}
@@ -19119,6 +19199,30 @@ func TestTimeline_GetAssignee(tt *testing.T) {
 	t.GetAssignee()
 }
 
+func TestTimeline_GetAssigner(tt *testing.T) {
+	t := &Timeline{}
+	t.GetAssigner()
+	t = nil
+	t.GetAssigner()
+}
+
+func TestTimeline_GetAuthor(tt *testing.T) {
+	t := &Timeline{}
+	t.GetAuthor()
+	t = nil
+	t.GetAuthor()
+}
+
+func TestTimeline_GetBody(tt *testing.T) {
+	var zeroValue string
+	t := &Timeline{Body: &zeroValue}
+	t.GetBody()
+	t = &Timeline{}
+	t.GetBody()
+	t = nil
+	t.GetBody()
+}
+
 func TestTimeline_GetCommitID(tt *testing.T) {
 	var zeroValue string
 	t := &Timeline{CommitID: &zeroValue}
@@ -19129,6 +19233,13 @@ func TestTimeline_GetCommitID(tt *testing.T) {
 	t.GetCommitID()
 }
 
+func TestTimeline_GetCommitter(tt *testing.T) {
+	t := &Timeline{}
+	t.GetCommitter()
+	t = nil
+	t.GetCommitter()
+}
+
 func TestTimeline_GetCommitURL(tt *testing.T) {
 	var zeroValue string
 	t := &Timeline{CommitURL: &zeroValue}
@@ -19176,6 +19287,16 @@ func TestTimeline_GetLabel(tt *testing.T) {
 	t.GetLabel()
 }
 
+func TestTimeline_GetMessage(tt *testing.T) {
+	var zeroValue string
+	t := &Timeline{Message: &zeroValue}
+	t.GetMessage()
+	t = &Timeline{}
+	t.GetMessage()
+	t = nil
+	t.GetMessage()
+}
+
 func TestTimeline_GetMilestone(tt *testing.T) {
 	t := &Timeline{}
 	t.GetMilestone()
@@ -19197,6 +19318,30 @@ func TestTimeline_GetRename(tt *testing.T) {
 	t.GetRename()
 }
 
+func TestTimeline_GetRequester(tt *testing.T) {
+	t := &Timeline{}
+	t.GetRequester()
+	t = nil
+	t.GetRequester()
+}
+
+func TestTimeline_GetReviewer(tt *testing.T) {
+	t := &Timeline{}
+	t.GetReviewer()
+	t = nil
+	t.GetReviewer()
+}
+
+func TestTimeline_GetSHA(tt *testing.T) {
+	var zeroValue string
+	t := &Timeline{SHA: &zeroValue}
+	t.GetSHA()
+	t = &Timeline{}
+	t.GetSHA()
+	t = nil
+	t.GetSHA()
+}
+
 func TestTimeline_GetSource(tt *testing.T) {
 	t := &Timeline{}
 	t.GetSource()
@@ -19214,6 +19359,16 @@ func TestTimeline_GetState(tt *testing.T) {
 	t.GetState()
 }
 
+func TestTimeline_GetSubmittedAt(tt *testing.T) {
+	var zeroValue time.Time
+	t := &Timeline{SubmittedAt: &zeroValue}
+	t.GetSubmittedAt()
+	t = &Timeline{}
+	t.GetSubmittedAt()
+	t = nil
+	t.GetSubmittedAt()
+}
+
 func TestTimeline_GetURL(tt *testing.T) {
 	var zeroValue string
 	t := &Timeline{URL: &zeroValue}
@@ -19224,6 +19379,13 @@ func TestTimeline_GetURL(tt *testing.T) {
 	t.GetURL()
 }
 
+func TestTimeline_GetUser(tt *testing.T) {
+	t := &Timeline{}
+	t.GetUser()
+	t = nil
+	t.GetUser()
+}
+
 func TestTool_GetGUID(tt *testing.T) {
 	var zeroValue string
 	t := &Tool{GUID: &zeroValue}
diff --git a/github/github_test.go b/github/github_test.go
index 08d2c8ad..dfa0d338 100644
--- a/github/github_test.go
+++ b/github/github_test.go
@@ -688,6 +688,40 @@ func TestResponse_cursorPagination(t *testing.T) {
 	}
 }
 
+func TestResponse_beforeAfterPagination(t *testing.T) {
+	r := http.Response{
+		Header: http.Header{
+			"Link": {`<https://api.github.com/?after=a1b2c3&before=>; rel="next",` +
+				` <https://api.github.com/?after=&before=>; rel="first",` +
+				` <https://api.github.com/?after=&before=d4e5f6>; rel="prev",`,
+			},
+		},
+	}
+
+	response := newResponse(&r)
+	if got, want := response.Before, "d4e5f6"; got != want {
+		t.Errorf("response.Before: %v, want %v", got, want)
+	}
+	if got, want := response.After, "a1b2c3"; got != want {
+		t.Errorf("response.After: %v, want %v", got, want)
+	}
+	if got, want := response.FirstPage, 0; got != want {
+		t.Errorf("response.FirstPage: %v, want %v", got, want)
+	}
+	if got, want := response.PrevPage, 0; want != got {
+		t.Errorf("response.PrevPage: %v, want %v", got, want)
+	}
+	if got, want := response.NextPage, 0; want != got {
+		t.Errorf("response.NextPage: %v, want %v", got, want)
+	}
+	if got, want := response.LastPage, 0; want != got {
+		t.Errorf("response.LastPage: %v, want %v", got, want)
+	}
+	if got, want := response.NextPageToken, ""; want != got {
+		t.Errorf("response.NextPageToken: %v, want %v", got, want)
+	}
+}
+
 func TestResponse_populatePageValues_invalid(t *testing.T) {
 	r := http.Response{
 		Header: http.Header{
diff --git a/github/issues_test.go b/github/issues_test.go
index 80bfb3ff..3ed7390f 100644
--- a/github/issues_test.go
+++ b/github/issues_test.go
@@ -345,6 +345,40 @@ func TestIssuesService_Edit(t *testing.T) {
 	})
 }
 
+func TestIssuesService_RemoveMilestone(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+	mux.HandleFunc("/repos/o/r/issues/1", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "PATCH")
+		fmt.Fprint(w, `{"number":1}`)
+	})
+
+	ctx := context.Background()
+	issue, _, err := client.Issues.RemoveMilestone(ctx, "o", "r", 1)
+	if err != nil {
+		t.Errorf("Issues.RemoveMilestone returned error: %v", err)
+	}
+
+	want := &Issue{Number: Int(1)}
+	if !cmp.Equal(issue, want) {
+		t.Errorf("Issues.RemoveMilestone returned %+v, want %+v", issue, want)
+	}
+
+	const methodName = "RemoveMilestone"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.Issues.RemoveMilestone(ctx, "\n", "\n", -1)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Issues.RemoveMilestone(ctx, "o", "r", 1)
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
+
 func TestIssuesService_Edit_invalidOwner(t *testing.T) {
 	client, _, _, teardown := setup()
 	defer teardown()
diff --git a/github/reactions_test.go b/github/reactions_test.go
index 3822a515..f84c3383 100644
--- a/github/reactions_test.go
+++ b/github/reactions_test.go
@@ -868,3 +868,41 @@ func TestReactionsService_DeleteTeamDiscussionCommentReactionByTeamIDAndOrgID(t
 		return client.Reactions.DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx, 1, 2, 3, 4, 5)
 	})
 }
+
+func TestReactionService_CreateReleaseReaction(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/releases/1/reactions", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "POST")
+		testHeader(t, r, "Accept", mediaTypeReactionsPreview)
+
+		w.WriteHeader(http.StatusCreated)
+		w.Write([]byte(`{"id":1,"user":{"login":"l","id":2},"content":"rocket"}`))
+	})
+
+	const methodName = "CreateReleaseReaction"
+	ctx := context.Background()
+	got, _, err := client.Reactions.CreateReleaseReaction(ctx, "o", "r", 1, "rocket")
+	if err != nil {
+		t.Errorf("%v returned error: %v", methodName, err)
+	}
+
+	want := &Reaction{ID: Int64(1), User: &User{Login: String("l"), ID: Int64(2)}, Content: String("rocket")}
+	if !cmp.Equal(got, want) {
+		t.Errorf("%v = %+v, want %+v", methodName, got, want)
+	}
+
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.Reactions.CreateReleaseReaction(ctx, "\n", "\n", -1, "\n")
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Reactions.CreateReleaseReaction(ctx, "o", "r", 1, "rocket")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
diff --git a/github/repos_environments_test.go b/github/repos_environments_test.go
index 4165ad75..18a30ad6 100644
--- a/github/repos_environments_test.go
+++ b/github/repos_environments_test.go
@@ -326,3 +326,97 @@ func TestRepoEnvironment_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, repoEnv, want)
 }
+
+func TestEnvReviewers_Marshal(t *testing.T) {
+	testJSONMarshal(t, &EnvReviewers{}, "{}")
+
+	repoEnv := &EnvReviewers{
+		Type: String("main"),
+		ID:   Int64(1),
+	}
+
+	want := `{
+		"type":"main",
+		"id":1
+	}`
+
+	testJSONMarshal(t, repoEnv, want)
+}
+
+func TestEnvironment_Marshal(t *testing.T) {
+	testJSONMarshal(t, &Environment{}, "{}")
+
+	repoEnv := &Environment{
+		Owner:           String("o"),
+		Repo:            String("r"),
+		EnvironmentName: String("e"),
+		WaitTimer:       Int(123),
+		Reviewers: []*EnvReviewers{
+			{
+				Type: String("main"),
+				ID:   Int64(1),
+			},
+			{
+				Type: String("rev"),
+				ID:   Int64(2),
+			},
+		},
+		DeploymentBranchPolicy: &BranchPolicy{
+			ProtectedBranches:    Bool(false),
+			CustomBranchPolicies: Bool(false),
+		},
+		ID:        Int64(2),
+		NodeID:    String("star"),
+		Name:      String("eg"),
+		URL:       String("https://hey.in"),
+		HTMLURL:   String("htmlurl"),
+		CreatedAt: &Timestamp{referenceTime},
+		UpdatedAt: &Timestamp{referenceTime},
+		ProtectionRules: []*ProtectionRule{
+			{
+				ID:        Int64(21),
+				NodeID:    String("mnb"),
+				Type:      String("ewq"),
+				WaitTimer: Int(9090),
+			},
+		},
+	}
+
+	want := `{
+		"owner":"o",
+		"repo":"r",
+		"environment_name":"e",
+		"wait_timer":123,
+		"reviewers":[
+			{
+				"type":"main",
+				"id":1
+			},
+			{
+				"type":"rev",
+				"id":2
+			}
+		],
+		"deployment_branch_policy":{
+			"protected_branches":false,
+			"custom_branch_policies":false
+		},
+		"id":2,
+		"node_id":"star",
+		"name":"eg",
+		"url":"https://hey.in",
+		"html_url":"htmlurl",
+		"created_at":` + referenceTimeStr + `,
+		"updated_at":` + referenceTimeStr + `,
+		"protection_rules":[
+			{
+				"id":21,
+				"node_id":"mnb",
+				"type":"ewq",
+				"wait_timer":9090
+			}
+		]
+	}`
+
+	testJSONMarshal(t, repoEnv, want)
+}
diff --git a/github/repos_releases_test.go b/github/repos_releases_test.go
index b67c83a0..bebbc0ed 100644
--- a/github/repos_releases_test.go
+++ b/github/repos_releases_test.go
@@ -820,3 +820,21 @@ func TestRepositoryRelease_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, u, want)
 }
+
+func TestGenerateNotesOptions_Marshal(t *testing.T) {
+	testJSONMarshal(t, &GenerateNotesOptions{}, "{}")
+
+	u := &GenerateNotesOptions{
+		TagName:         "tag_name",
+		PreviousTagName: String("previous_tag_name"),
+		TargetCommitish: String("target_commitish"),
+	}
+
+	want := `{
+		"tag_name":          "tag_name",
+		"previous_tag_name": "previous_tag_name",
+		"target_commitish":  "target_commitish"
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/repos_test.go b/github/repos_test.go
index dee5fdf8..dae6d221 100644
--- a/github/repos_test.go
+++ b/github/repos_test.go
@@ -981,6 +981,51 @@ func TestRepositoriesService_GetBranch_notFound(t *testing.T) {
 	})
 }
 
+func TestRepositoriesService_RenameBranch(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	renameBranchReq := "nn"
+
+	mux.HandleFunc("/repos/o/r/branches/b/rename", func(w http.ResponseWriter, r *http.Request) {
+		v := new(renameBranchRequest)
+		json.NewDecoder(r.Body).Decode(v)
+
+		testMethod(t, r, "POST")
+		want := &renameBranchRequest{NewName: "nn"}
+		if !cmp.Equal(v, want) {
+			t.Errorf("Request body = %+v, want %+v", v, want)
+		}
+
+		fmt.Fprint(w, `{"protected":true,"name":"nn"}`)
+	})
+
+	ctx := context.Background()
+	got, _, err := client.Repositories.RenameBranch(ctx, "o", "r", "b", renameBranchReq)
+	if err != nil {
+		t.Errorf("Repositories.RenameBranch returned error: %v", err)
+	}
+
+	want := &Branch{Name: String("nn"), Protected: Bool(true)}
+	if !cmp.Equal(got, want) {
+		t.Errorf("Repositories.RenameBranch returned %+v, want %+v", got, want)
+	}
+
+	const methodName = "RenameBranch"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.Repositories.RenameBranch(ctx, "\n", "\n", "\n", renameBranchReq)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Repositories.RenameBranch(ctx, "o", "r", "b", renameBranchReq)
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
+
 func TestRepositoriesService_GetBranchProtection(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
@@ -2353,3 +2398,17 @@ func TestRepositoriesService_Dispatch(t *testing.T) {
 		return resp, err
 	})
 }
+
+func TestAdvancedSecurity_Marshal(t *testing.T) {
+	testJSONMarshal(t, &AdvancedSecurity{}, "{}")
+
+	u := &AdvancedSecurity{
+		Status: String("status"),
+	}
+
+	want := `{
+		"status": "status"
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/repos_traffic_test.go b/github/repos_traffic_test.go
index adb4dfb3..88046b7b 100644
--- a/github/repos_traffic_test.go
+++ b/github/repos_traffic_test.go
@@ -218,3 +218,93 @@ func TestTrafficReferrer_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, u, want)
 }
+
+func TestTrafficViews_Marshal(t *testing.T) {
+	testJSONMarshal(t, &TrafficViews{}, "{}")
+
+	u := &TrafficViews{
+		Views: []*TrafficData{{
+			Timestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)},
+			Count:     Int(7),
+			Uniques:   Int(6),
+		}},
+		Count:   Int(0),
+		Uniques: Int(0),
+	}
+
+	want := `{
+		"views": [{
+			"timestamp": "2016-05-31T16:00:00.000Z",
+			"count": 7,
+			"uniques": 6
+		}],
+		"count" : 0,
+		"uniques" : 0
+	}`
+
+	testJSONMarshal(t, u, want)
+}
+
+func TestTrafficClones_Marshal(t *testing.T) {
+	testJSONMarshal(t, &TrafficClones{}, "{}")
+
+	u := &TrafficClones{
+		Clones: []*TrafficData{{
+			Timestamp: &Timestamp{time.Date(2021, time.October, 29, 16, 0, 0, 0, time.UTC)},
+			Count:     Int(1),
+			Uniques:   Int(1),
+		}},
+		Count:   Int(0),
+		Uniques: Int(0),
+	}
+
+	want := `{
+		"clones": [{
+			"timestamp": "2021-10-29T16:00:00.000Z",
+			"count": 1,
+			"uniques": 1
+		}],
+		"count" : 0,
+		"uniques" : 0
+	}`
+
+	testJSONMarshal(t, u, want)
+}
+
+func TestTrafficPath_Marshal(t *testing.T) {
+	testJSONMarshal(t, &TrafficPath{}, "{}")
+
+	u := &TrafficPath{
+		Path:    String("test/path"),
+		Title:   String("test"),
+		Count:   Int(2),
+		Uniques: Int(3),
+	}
+
+	want := `{
+		"path" : "test/path",
+		"title": "test",
+		"count": 2,
+		"uniques": 3
+	}`
+
+	testJSONMarshal(t, u, want)
+}
+
+func TestTrafficData_Marshal(t *testing.T) {
+	testJSONMarshal(t, &TrafficData{}, "{}")
+
+	u := &TrafficData{
+		Timestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)},
+		Count:     Int(7),
+		Uniques:   Int(6),
+	}
+
+	want := `{	
+			"timestamp": "2016-05-31T16:00:00.000Z",
+			"count": 7,
+			"uniques": 6
+      }`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/scim_test.go b/github/scim_test.go
index 3338a28a..328bc209 100644
--- a/github/scim_test.go
+++ b/github/scim_test.go
@@ -192,3 +192,51 @@ func TestSCIMService_DeleteSCIMUserFromOrg(t *testing.T) {
 		return client.SCIM.DeleteSCIMUserFromOrg(ctx, "o", "123")
 	})
 }
+
+func TestSCIMUserAttributes_Marshal(t *testing.T) {
+	testJSONMarshal(t, &SCIMUserAttributes{}, `{
+		"userName":"","name":{"givenName":"","familyName":""},"emails":null
+	}`)
+
+	u := &SCIMUserAttributes{
+		UserName: "userName1",
+		Name: SCIMUserName{
+			GivenName:  "Name1",
+			FamilyName: "Fname",
+			Formatted:  String("formatted name"),
+		},
+		DisplayName: String("Name"),
+		Emails: []*SCIMUserEmail{
+			{
+				Value:   "value",
+				Primary: Bool(false),
+				Type:    String("type"),
+			},
+		},
+		Schemas:    []string{"schema1"},
+		ExternalID: String("id"),
+		Groups:     []string{"group1"},
+		Active:     Bool(true),
+	}
+
+	want := `{
+		"userName": "userName1",
+		"name": {
+			"givenName": "Name1",
+			"familyName": "Fname",
+			"formatted": "formatted name"
+		},
+		"displayName": "Name",
+		"emails": [{
+			"value": "value",
+			"primary": false,
+			"type": "type"
+		}],
+		"schemas": ["schema1"],
+		"externalId": "id",
+		"groups": ["group1"],
+		"active": true
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/search_test.go b/github/search_test.go
index f5cdd068..4562fcf5 100644
--- a/github/search_test.go
+++ b/github/search_test.go
@@ -575,3 +575,224 @@ func TestRepositoriesSearchResult_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, u, want)
 }
+
+func TestCommitsSearchResult_Marshal(t *testing.T) {
+	testJSONMarshal(t, &CommitsSearchResult{}, "{}")
+
+	c := &CommitsSearchResult{
+		Total:             Int(0),
+		IncompleteResults: Bool(true),
+		Commits: []*CommitResult{{
+			SHA: String("s"),
+		}},
+	}
+
+	want := `{
+		"total_count" : 0,
+		"incomplete_results" : true,
+		"items" : [{"sha" : "s"}]
+	}`
+
+	testJSONMarshal(t, c, want)
+}
+
+func TestTopicsSearchResult_Marshal(t *testing.T) {
+	testJSONMarshal(t, &TopicsSearchResult{}, "{}")
+
+	u := &TopicsSearchResult{
+		Total:             Int(2),
+		IncompleteResults: Bool(false),
+		Topics: []*TopicResult{
+			{
+				Name:             String("t1"),
+				DisplayName:      String("tt"),
+				ShortDescription: String("t desc"),
+				Description:      String("desc"),
+				CreatedBy:        String("mi"),
+				CreatedAt:        &Timestamp{referenceTime},
+				UpdatedAt:        String("2006-01-02T15:04:05Z"),
+				Featured:         Bool(true),
+				Curated:          Bool(true),
+				Score:            Float64(123),
+			},
+		},
+	}
+
+	want := `{
+		"total_count" : 2,
+		"incomplete_results" : false,
+		"items" : [
+			{
+				"name" : "t1",
+				"display_name":"tt",
+				"short_description":"t desc",
+				"description":"desc",
+				"created_by":"mi",
+				"created_at":` + referenceTimeStr + `,
+				"updated_at":"2006-01-02T15:04:05Z",
+				"featured":true,
+				"curated":true,
+				"score":123
+			}
+		]
+	}`
+
+	testJSONMarshal(t, u, want)
+}
+
+func TestLabelResult_Marshal(t *testing.T) {
+	testJSONMarshal(t, &LabelResult{}, "{}")
+
+	u := &LabelResult{
+		ID:          Int64(11),
+		URL:         String("url"),
+		Name:        String("label"),
+		Color:       String("green"),
+		Default:     Bool(true),
+		Description: String("desc"),
+		Score:       Float64(123),
+	}
+
+	want := `{
+		"id":11,
+		"url":"url",
+		"name":"label",
+		"color":"green",
+		"default":true,
+		"description":"desc",
+		"score":123
+	}`
+
+	testJSONMarshal(t, u, want)
+}
+
+func TestSearchOptions_Marshal(t *testing.T) {
+	testJSONMarshal(t, &SearchOptions{}, "{}")
+
+	u := &SearchOptions{
+		Sort:      "author-date",
+		Order:     "asc",
+		TextMatch: false,
+		ListOptions: ListOptions{
+			Page:    int(1),
+			PerPage: int(10),
+		},
+	}
+
+	want := `{	
+		"sort": "author-date",
+		"order": "asc",
+		"page": 1,
+		"perPage": 10
+      }`
+
+	testJSONMarshal(t, u, want)
+}
+
+func TestIssuesSearchResult_Marshal(t *testing.T) {
+	testJSONMarshal(t, &IssuesSearchResult{}, "{}")
+
+	u := &IssuesSearchResult{
+		Total:             Int(48),
+		IncompleteResults: Bool(false),
+		Issues: []*Issue{
+			{
+				ID:                Int64(1),
+				Number:            Int(1),
+				State:             String("s"),
+				Locked:            Bool(false),
+				Title:             String("title"),
+				Body:              String("body"),
+				AuthorAssociation: String("aa"),
+				User:              &User{ID: Int64(1)},
+				Labels:            []*Label{{ID: Int64(1)}},
+				Assignee:          &User{ID: Int64(1)},
+				Comments:          Int(1),
+				ClosedAt:          &referenceTime,
+				CreatedAt:         &referenceTime,
+				UpdatedAt:         &referenceTime,
+				ClosedBy:          &User{ID: Int64(1)},
+				URL:               String("url"),
+				HTMLURL:           String("hurl"),
+				CommentsURL:       String("curl"),
+				EventsURL:         String("eurl"),
+				LabelsURL:         String("lurl"),
+				RepositoryURL:     String("rurl"),
+				Milestone:         &Milestone{ID: Int64(1)},
+				PullRequestLinks:  &PullRequestLinks{URL: String("url")},
+				Repository:        &Repository{ID: Int64(1)},
+				Reactions:         &Reactions{TotalCount: Int(1)},
+				Assignees:         []*User{{ID: Int64(1)}},
+				NodeID:            String("nid"),
+				TextMatches:       []*TextMatch{{ObjectURL: String("ourl")}},
+				ActiveLockReason:  String("alr"),
+			},
+		},
+	}
+
+	want := `{
+		"total_count": 48,
+		"incomplete_results": false,
+		"items": [
+			{
+				"id": 1,
+				"number": 1,
+				"state": "s",
+				"locked": false,
+				"title": "title",
+				"body": "body",
+				"author_association": "aa",
+				"user": {
+					"id": 1
+				},
+				"labels": [
+					{
+						"id": 1
+					}
+				],
+				"assignee": {
+					"id": 1
+				},
+				"comments": 1,
+				"closed_at": ` + referenceTimeStr + `,
+				"created_at": ` + referenceTimeStr + `,
+				"updated_at": ` + referenceTimeStr + `,
+				"closed_by": {
+					"id": 1
+				},
+				"url": "url",
+				"html_url": "hurl",
+				"comments_url": "curl",
+				"events_url": "eurl",
+				"labels_url": "lurl",
+				"repository_url": "rurl",
+				"milestone": {
+					"id": 1
+				},
+				"pull_request": {
+					"url": "url"
+				},
+				"repository": {
+					"id": 1
+				},
+				"reactions": {
+					"total_count": 1
+				},
+				"assignees": [
+					{
+						"id": 1
+					}
+				],
+				"node_id": "nid",
+				"text_matches": [
+					{
+						"object_url": "ourl"
+					}
+				],
+				"active_lock_reason": "alr"
+			}
+		]
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/teams_discussion_comments_test.go b/github/teams_discussion_comments_test.go
index 3f911650..f6b5433b 100644
--- a/github/teams_discussion_comments_test.go
+++ b/github/teams_discussion_comments_test.go
@@ -431,3 +431,63 @@ func TestTeamsService_DeleteComment(t *testing.T) {
 		return resp, err
 	})
 }
+
+func TestDiscussionComment_Marshal(t *testing.T) {
+	testJSONMarshal(t, &DiscussionComment{}, "{}")
+
+	u := &DiscussionComment{
+		Author:        &User{},
+		Body:          String("body"),
+		BodyHTML:      String("body html"),
+		BodyVersion:   String("body version"),
+		CreatedAt:     &Timestamp{referenceTime},
+		LastEditedAt:  &Timestamp{referenceTime},
+		DiscussionURL: String("url"),
+		HTMLURL:       String("html url"),
+		NodeID:        String("node"),
+		Number:        Int(1),
+		UpdatedAt:     &Timestamp{referenceTime},
+		URL:           String("url"),
+		Reactions: &Reactions{
+			TotalCount: Int(10),
+			PlusOne:    Int(1),
+			MinusOne:   Int(1),
+			Laugh:      Int(1),
+			Confused:   Int(1),
+			Heart:      Int(2),
+			Hooray:     Int(5),
+			Rocket:     Int(3),
+			Eyes:       Int(9),
+			URL:        String("url"),
+		},
+	}
+
+	want := `{
+		"author":{},
+		"body":"body",
+		"body_html":"body html",
+		"body_version":"body version",
+		"created_at":` + referenceTimeStr + `,
+		"last_edited_at":` + referenceTimeStr + `,
+		"discussion_url":"url",
+		"html_url":"html url",
+		"node_id":"node",
+		"number":1,
+		"updated_at":` + referenceTimeStr + `,
+		"url":"url",
+		"reactions":{
+			"total_count": 10,
+			"+1": 1,
+			"-1": 1,
+			"laugh": 1,
+			"confused": 1,
+			"heart": 2,
+			"hooray": 5,
+			"rocket": 3,
+			"eyes": 9,
+			"url":"url"
+		}
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/teams_discussions_test.go b/github/teams_discussions_test.go
index 3c94f566..06328acb 100644
--- a/github/teams_discussions_test.go
+++ b/github/teams_discussions_test.go
@@ -541,3 +541,47 @@ func TestTeamsService_DeleteDiscussionBySlug(t *testing.T) {
 		return client.Teams.DeleteDiscussionBySlug(ctx, "o", "s", 3)
 	})
 }
+
+func TestTeamDiscussion_Marshal(t *testing.T) {
+	testJSONMarshal(t, &TeamDiscussion{}, "{}")
+
+	u := &TeamDiscussion{
+		Author: &User{
+			Login:       String("author"),
+			ID:          Int64(0),
+			URL:         String("https://api.github.com/users/author"),
+			AvatarURL:   String("https://avatars1.githubusercontent.com/u/0?v=4"),
+			GravatarID:  String(""),
+			CreatedAt:   &Timestamp{referenceTime},
+			SuspendedAt: &Timestamp{referenceTime},
+		},
+		Body:          String("test"),
+		BodyHTML:      String("<p>test</p>"),
+		BodyVersion:   String("version"),
+		CommentsCount: Int(1),
+		CommentsURL:   String("https://api.github.com/teams/2/discussions/3/comments"),
+		CreatedAt:     &Timestamp{referenceTime},
+		LastEditedAt:  &Timestamp{referenceTime},
+	}
+
+	want := `{
+		"author": {
+			"login": "author",
+			"id": 0,
+			"avatar_url": "https://avatars1.githubusercontent.com/u/0?v=4",
+			"gravatar_id": "",
+			"url": "https://api.github.com/users/author",
+			"created_at": ` + referenceTimeStr + `,
+			"suspended_at": ` + referenceTimeStr + `	
+		},
+		"body": "test",
+		"body_html": "<p>test</p>",
+		"body_version": "version",
+		"comments_count": 1,
+		"comments_url": "https://api.github.com/teams/2/discussions/3/comments",
+		"created_at": ` + referenceTimeStr + `,
+		"last_edited_at": ` + referenceTimeStr + `
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/teams_test.go b/github/teams_test.go
index 748721c3..26cf2c03 100644
--- a/github/teams_test.go
+++ b/github/teams_test.go
@@ -1586,6 +1586,34 @@ func TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_empty(t *testing.T
 	}
 }
 
+func TestNewTeam_Marshal(t *testing.T) {
+	testJSONMarshal(t, &NewTeam{}, "{}")
+
+	u := &NewTeam{
+		Name:         "n",
+		Description:  String("d"),
+		Maintainers:  []string{"m1", "m2"},
+		RepoNames:    []string{"repo1", "repo2"},
+		ParentTeamID: Int64(1),
+		Permission:   String("perm"),
+		Privacy:      String("p"),
+		LDAPDN:       String("l"),
+	}
+
+	want := `{
+		"name":           "n",
+		"description":    "d",
+		"maintainers":    ["m1", "m2"],
+		"repo_names":     ["repo1", "repo2"],
+		"parent_team_id": 1,
+		"permission":     "perm",
+		"privacy":        "p",
+		"ldap_dn":        "l"
+	}`
+
+	testJSONMarshal(t, u, want)
+}
+
 func TestTeams_Marshal(t *testing.T) {
 	testJSONMarshal(t, &Team{}, "{}")
 
@@ -1671,3 +1699,49 @@ func TestTeams_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, u, want)
 }
+
+func TestInvitation_Marshal(t *testing.T) {
+	testJSONMarshal(t, &Invitation{}, "{}")
+
+	u := &Invitation{
+		ID:                Int64(1),
+		NodeID:            String("test node"),
+		Login:             String("login123"),
+		Email:             String("go@github.com"),
+		Role:              String("developer"),
+		CreatedAt:         &referenceTime,
+		TeamCount:         Int(99),
+		InvitationTeamURL: String("url"),
+	}
+
+	want := `{
+		"id": 1,
+		"node_id": "test node",
+		"login":"login123",
+		"email":"go@github.com",
+		"role":"developer",
+		"created_at":` + referenceTimeStr + `,
+		"team_count":99,
+		"invitation_team_url":"url"
+	}`
+
+	testJSONMarshal(t, u, want)
+}
+
+func TestIDPGroup_Marshal(t *testing.T) {
+	testJSONMarshal(t, &IDPGroup{}, "{}")
+
+	u := &IDPGroup{
+		GroupID:          String("abc1"),
+		GroupName:        String("test group"),
+		GroupDescription: String("test group descripation"),
+	}
+
+	want := `{
+		"group_id": "abc1",
+		"group_name": "test group",
+		"group_description":"test group descripation"
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/users_gpg_keys_test.go b/github/users_gpg_keys_test.go
index 9f7bb9e4..2cef7522 100644
--- a/github/users_gpg_keys_test.go
+++ b/github/users_gpg_keys_test.go
@@ -11,6 +11,7 @@ import (
 	"fmt"
 	"net/http"
 	"testing"
+	"time"
 
 	"github.com/google/go-cmp/cmp"
 )
@@ -205,3 +206,57 @@ func TestGPGEmail_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, u, want)
 }
+
+func TestGPGKey_Marshal(t *testing.T) {
+	testJSONMarshal(t, &GPGKey{}, "{}")
+
+	ti := &time.Time{}
+
+	g := &GPGKey{
+		ID:           Int64(1),
+		PrimaryKeyID: Int64(1),
+		KeyID:        String("someKeyID"),
+		RawKey:       String("someRawKeyID"),
+		PublicKey:    String("somePublicKey"),
+		Emails: []*GPGEmail{
+			{
+				Email:    String("someEmail"),
+				Verified: Bool(true),
+			},
+		},
+		Subkeys: []*GPGKey{
+			{},
+		},
+		CanSign:           Bool(true),
+		CanEncryptComms:   Bool(true),
+		CanEncryptStorage: Bool(true),
+		CanCertify:        Bool(true),
+		CreatedAt:         ti,
+		ExpiresAt:         ti,
+	}
+
+	want := `{
+			"id":1,
+			"primary_key_id":1,
+			"key_id":"someKeyID",
+			"raw_key":"someRawKeyID",
+			"public_key":"somePublicKey",
+			"emails":[
+				{
+					"email":"someEmail",
+					"verified":true
+				}
+			],
+			"subkeys":[
+				{}
+			],
+			"can_sign":true,
+			"can_encrypt_comms":true,
+			"can_encrypt_storage":true,
+			"can_certify":true,
+			"created_at":"0001-01-01T00:00:00Z",
+			"expires_at":"0001-01-01T00:00:00Z"
+		}`
+
+	testJSONMarshal(t, g, want)
+}
diff --git a/github/users_keys_test.go b/github/users_keys_test.go
index 14effc1b..b3e5fc9e 100644
--- a/github/users_keys_test.go
+++ b/github/users_keys_test.go
@@ -180,3 +180,29 @@ func TestUsersService_DeleteKey(t *testing.T) {
 		return client.Users.DeleteKey(ctx, 1)
 	})
 }
+
+func TestKey_Marshal(t *testing.T) {
+	testJSONMarshal(t, &Key{}, "{}")
+
+	u := &Key{
+		ID:        Int64(1),
+		Key:       String("abc"),
+		URL:       String("url"),
+		Title:     String("title"),
+		ReadOnly:  Bool(true),
+		Verified:  Bool(true),
+		CreatedAt: &Timestamp{referenceTime},
+	}
+
+	want := `{
+		"id": 1,
+		"key": "abc",
+		"url": "url",
+		"title": "title",
+		"read_only": true,
+		"verified": true,
+		"created_at": ` + referenceTimeStr + `
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/users_projects_test.go b/github/users_projects_test.go
index 4f4b5e26..28c46107 100644
--- a/github/users_projects_test.go
+++ b/github/users_projects_test.go
@@ -92,3 +92,19 @@ func TestUsersService_CreateProject(t *testing.T) {
 		return resp, err
 	})
 }
+
+func TestCreateUserProjectOptions_Marshal(t *testing.T) {
+	testJSONMarshal(t, &CreateUserProjectOptions{}, `{}`)
+
+	c := CreateUserProjectOptions{
+		Name: "SomeProject",
+		Body: String("SomeProjectBody"),
+	}
+
+	want := `{
+			"name": "SomeProject",
+			"body": "SomeProjectBody"
+		}`
+
+	testJSONMarshal(t, c, want)
+}
diff --git a/github/users_test.go b/github/users_test.go
index c53672d0..8acd529c 100644
--- a/github/users_test.go
+++ b/github/users_test.go
@@ -383,3 +383,47 @@ func TestUserContext_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, u, want)
 }
+
+func TestHovercard_Marshal(t *testing.T) {
+	testJSONMarshal(t, &Hovercard{}, "{}")
+
+	h := &Hovercard{
+		Contexts: []*UserContext{
+			{
+				Message: String("someMessage"),
+				Octicon: String("someOcticon"),
+			},
+		},
+	}
+
+	want := `{
+		"contexts" : [
+			{
+				"message" : "someMessage",
+				"octicon" : "someOcticon"
+			}
+		]
+	}`
+
+	testJSONMarshal(t, h, want)
+}
+
+func TestUserListOptions_Marshal(t *testing.T) {
+	testJSONMarshal(t, &UserListOptions{}, "{}")
+
+	u := &UserListOptions{
+		Since: int64(1900),
+		ListOptions: ListOptions{
+			Page:    int(1),
+			PerPage: int(10),
+		},
+	}
+
+	want := `{
+		"since" : 1900,
+		"page": 1,
+		"perPage": 10
+	}`
+
+	testJSONMarshal(t, u, want)
+}
diff --git a/scrape/apps_test.go b/scrape/apps_test.go
index 88640879..5390f7ed 100644
--- a/scrape/apps_test.go
+++ b/scrape/apps_test.go
@@ -5,7 +5,7 @@ import (
 	"testing"
 
 	"github.com/google/go-cmp/cmp"
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 )
 
 func Test_AppRestrictionsEnabled(t *testing.T) {
diff --git a/test/fields/fields.go b/test/fields/fields.go
index b6674ce1..b69b08c0 100644
--- a/test/fields/fields.go
+++ b/test/fields/fields.go
@@ -25,7 +25,7 @@ import (
 	"reflect"
 	"strings"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/oauth2"
 )
 
diff --git a/test/integration/activity_test.go b/test/integration/activity_test.go
index afcc4e63..1c257ef9 100644
--- a/test/integration/activity_test.go
+++ b/test/integration/activity_test.go
@@ -12,7 +12,7 @@ import (
 	"context"
 	"testing"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 )
 
 const (
diff --git a/test/integration/authorizations_test.go b/test/integration/authorizations_test.go
index 5566162a..860a358a 100644
--- a/test/integration/authorizations_test.go
+++ b/test/integration/authorizations_test.go
@@ -17,7 +17,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 )
 
 const msgEnvMissing = "Skipping test because the required environment variable (%v) is not present."
diff --git a/test/integration/github_test.go b/test/integration/github_test.go
index a79702da..c99b8957 100644
--- a/test/integration/github_test.go
+++ b/test/integration/github_test.go
@@ -15,7 +15,7 @@ import (
 	"net/http"
 	"os"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 	"golang.org/x/oauth2"
 )
 
diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go
index 5f6127cc..77f9fb52 100644
--- a/test/integration/repos_test.go
+++ b/test/integration/repos_test.go
@@ -16,7 +16,7 @@ import (
 	"testing"
 
 	"github.com/google/go-cmp/cmp"
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 )
 
 func TestRepositories_CRUD(t *testing.T) {
diff --git a/test/integration/users_test.go b/test/integration/users_test.go
index cccea45b..f25fa8f0 100644
--- a/test/integration/users_test.go
+++ b/test/integration/users_test.go
@@ -14,7 +14,7 @@ import (
 	"math/rand"
 	"testing"
 
-	"github.com/google/go-github/v39/github"
+	"github.com/google/go-github/v40/github"
 )
 
 func TestUsers_Get(t *testing.T) {