Repository: google/go-github
Pull request #2388 (2022-06-17 07:35:22)

Add TextMatch custom header to other search type custom headers
Fix TextMatch Option doesn't work when search type is commits topics repositories or issues (#2385)

Fixes: #2385.

google-cla[bot]: Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this [failed invocation](https://github.com/google/go-github/pull/2388/checks?check_run_id=6932150516) of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.
codecov[bot]: # [Codecov](https://codecov.io/gh/google/go-github/pull/2388?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#2388](https://codecov.io/gh/google/go-github/pull/2388?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (647e6ac) into [master](https://codecov.io/gh/google/go-github/commit/697804fa0c8abebdfaa79ae8e7393d03de6ab86f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (697804f) will **decrease** coverage by `0.00%`.
> The diff coverage is `100.00%`.

```diff
@@            Coverage Diff             @@
##           master    #2388      +/-   ##
==========================================
- Coverage   98.06%   98.06%   -0.01%     
==========================================
  Files         119      119              
  Lines       10545    10544       -1     
==========================================
- Hits        10341    10340       -1     
  Misses        140      140              
  Partials       64       64              
```


| [Impacted Files](https://codecov.io/gh/google/go-github/pull/2388?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | |
|---|---|---|
| [github/search.go](https://codecov.io/gh/google/go-github/pull/2388/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL3NlYXJjaC5nbw==) | `93.40% <100.00%> (-0.08%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/google/go-github/pull/2388?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/google/go-github/pull/2388?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Last update [697804f...647e6ac](https://codecov.io/gh/google/go-github/pull/2388?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).


Patch:
diff --git a/example/tagprotection/main.go b/example/tagprotection/main.go
new file mode 100644
index 00000000..6f347b97
--- /dev/null
+++ b/example/tagprotection/main.go
@@ -0,0 +1,76 @@
+// Copyright 2022 The go-github AUTHORS. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// The tagprotection command demonstrates the functionality that
+// prompts the user for GitHub owner, repo, tag protection pattern and token,
+// then creates a new tag protection if the user entered a pattern at the prompt.
+// Otherwise, it will just list all existing tag protections.
+package main
+
+import (
+	"bufio"
+	"context"
+	"encoding/json"
+	"fmt"
+	"log"
+	"os"
+	"strings"
+	"syscall"
+
+	"github.com/google/go-github/v45/github"
+	"golang.org/x/crypto/ssh/terminal"
+	"golang.org/x/oauth2"
+)
+
+func main() {
+	// read github owner, repo, token from standard input
+	r := bufio.NewReader(os.Stdin)
+	fmt.Print("GitHub Org/User name: ")
+	owner, _ := r.ReadString('\n')
+	owner = strings.TrimSpace(owner)
+
+	fmt.Print("GitHub repo name: ")
+	repo, _ := r.ReadString('\n')
+	repo = strings.TrimSpace(repo)
+
+	fmt.Print("Tag pattern(leave blank to not create new tag protection): ")
+	pattern, _ := r.ReadString('\n')
+	pattern = strings.TrimSpace(pattern)
+
+	fmt.Print("GitHub Token: ")
+	byteToken, _ := terminal.ReadPassword(int(syscall.Stdin))
+	println()
+	token := string(byteToken)
+
+	ctx := context.Background()
+	ts := oauth2.StaticTokenSource(
+		&oauth2.Token{AccessToken: token},
+	)
+	tc := oauth2.NewClient(ctx, ts)
+
+	client := github.NewClient(tc)
+
+	// create new tag protection
+	if pattern != "" {
+		tagProtection, _, err := client.Repositories.CreateTagProtection(ctx, owner, repo, pattern)
+		if err != nil {
+			log.Fatalf("Error: %v\n", err)
+		}
+		println()
+		fmt.Printf("New tag protection created in github.com/%v/%v\n", owner, repo)
+		tp, _ := json.Marshal(tagProtection)
+		fmt.Println(string(tp))
+	}
+
+	// list all tag protection
+	println()
+	fmt.Printf("List all tag protection in github.com/%v/%v\n", owner, repo)
+	tagProtections, _, err := client.Repositories.ListTagProtection(ctx, owner, repo)
+	if err != nil {
+		log.Fatalf("Error: %v\n", err)
+	}
+	results, _ := json.Marshal(tagProtections)
+	fmt.Println(string(results))
+}
diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go
index 18fdd57d..9fd01c4a 100644
--- a/github/actions_workflow_runs.go
+++ b/github/actions_workflow_runs.go
@@ -94,6 +94,14 @@ type WorkflowRunAttemptOptions struct {
 	ExcludePullRequests *bool `url:"exclude_pull_requests,omitempty"`
 }
 
+// PendingDeploymentsRequest specifies body parameters to PendingDeployments.
+type PendingDeploymentsRequest struct {
+	EnvironmentIDs []int64 `json:"environment_ids"`
+	// State can be one of: "approved", "rejected".
+	State   string `json:"state"`
+	Comment string `json:"comment"`
+}
+
 func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) {
 	u, err := addOptions(endpoint, opts)
 	if err != nil {
@@ -321,3 +329,23 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep
 
 	return workflowRunUsage, resp, nil
 }
+
+// PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer.
+//
+// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run
+func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/pending_deployments", owner, repo, runID)
+
+	req, err := s.client.NewRequest("POST", u, request)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	var deployments []*Deployment
+	resp, err := s.client.Do(ctx, req, &deployments)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return deployments, resp, nil
+}
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 6131fad9..013780bf 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -1030,6 +1030,14 @@ func (a *AuditEntry) GetRepositoryPublic() bool {
 	return *a.RepositoryPublic
 }
 
+// GetRunAttempt returns the RunAttempt field if it's non-nil, zero value otherwise.
+func (a *AuditEntry) GetRunAttempt() int64 {
+	if a == nil || a.RunAttempt == nil {
+		return 0
+	}
+	return *a.RunAttempt
+}
+
 // GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise.
 func (a *AuditEntry) GetRunnerGroupID() int64 {
 	if a == nil || a.RunnerGroupID == nil {
@@ -2286,6 +2294,14 @@ func (c *CodeOfConduct) GetURL() string {
 	return *c.URL
 }
 
+// GetSuggestion returns the Suggestion field if it's non-nil, zero value otherwise.
+func (c *CodeownersError) GetSuggestion() string {
+	if c == nil || c.Suggestion == nil {
+		return ""
+	}
+	return *c.Suggestion
+}
+
 // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.
 func (c *CodeResult) GetHTMLURL() string {
 	if c == nil || c.HTMLURL == nil {
@@ -7630,6 +7646,14 @@ func (i *IssueRequest) GetState() string {
 	return *i.State
 }
 
+// GetStateReason returns the StateReason field if it's non-nil, zero value otherwise.
+func (i *IssueRequest) GetStateReason() string {
+	if i == nil || i.StateReason == nil {
+		return ""
+	}
+	return *i.StateReason
+}
+
 // GetTitle returns the Title field if it's non-nil, zero value otherwise.
 func (i *IssueRequest) GetTitle() string {
 	if i == nil || i.Title == nil {
@@ -9622,6 +9646,14 @@ func (o *Organization) GetMembersCanCreateRepos() bool {
 	return *o.MembersCanCreateRepos
 }
 
+// GetMembersCanForkPrivateRepos returns the MembersCanForkPrivateRepos field if it's non-nil, zero value otherwise.
+func (o *Organization) GetMembersCanForkPrivateRepos() bool {
+	if o == nil || o.MembersCanForkPrivateRepos == nil {
+		return false
+	}
+	return *o.MembersCanForkPrivateRepos
+}
+
 // GetMembersURL returns the MembersURL field if it's non-nil, zero value otherwise.
 func (o *Organization) GetMembersURL() string {
 	if o == nil || o.MembersURL == nil {
@@ -10774,12 +10806,12 @@ func (p *PagesUpdate) GetPublic() bool {
 	return *p.Public
 }
 
-// GetSource returns the Source field if it's non-nil, zero value otherwise.
-func (p *PagesUpdate) GetSource() string {
-	if p == nil || p.Source == nil {
-		return ""
+// GetSource returns the Source field.
+func (p *PagesUpdate) GetSource() *PagesSource {
+	if p == nil {
+		return nil
 	}
-	return *p.Source
+	return p.Source
 }
 
 // GetHook returns the Hook field.
@@ -12878,6 +12910,14 @@ func (p *PullRequestReviewRequest) GetNodeID() string {
 	return *p.NodeID
 }
 
+// GetBypassPullRequestAllowances returns the BypassPullRequestAllowances field.
+func (p *PullRequestReviewsEnforcement) GetBypassPullRequestAllowances() *BypassPullRequestAllowances {
+	if p == nil {
+		return nil
+	}
+	return p.BypassPullRequestAllowances
+}
+
 // GetDismissalRestrictions returns the DismissalRestrictions field.
 func (p *PullRequestReviewsEnforcement) GetDismissalRestrictions() *DismissalRestrictions {
 	if p == nil {
@@ -12886,6 +12926,14 @@ func (p *PullRequestReviewsEnforcement) GetDismissalRestrictions() *DismissalRes
 	return p.DismissalRestrictions
 }
 
+// GetBypassPullRequestAllowancesRequest returns the BypassPullRequestAllowancesRequest field.
+func (p *PullRequestReviewsEnforcementRequest) GetBypassPullRequestAllowancesRequest() *BypassPullRequestAllowancesRequest {
+	if p == nil {
+		return nil
+	}
+	return p.BypassPullRequestAllowancesRequest
+}
+
 // GetDismissalRestrictionsRequest returns the DismissalRestrictionsRequest field.
 func (p *PullRequestReviewsEnforcementRequest) GetDismissalRestrictionsRequest() *DismissalRestrictionsRequest {
 	if p == nil {
@@ -12894,6 +12942,14 @@ func (p *PullRequestReviewsEnforcementRequest) GetDismissalRestrictionsRequest()
 	return p.DismissalRestrictionsRequest
 }
 
+// GetBypassPullRequestAllowancesRequest returns the BypassPullRequestAllowancesRequest field.
+func (p *PullRequestReviewsEnforcementUpdate) GetBypassPullRequestAllowancesRequest() *BypassPullRequestAllowancesRequest {
+	if p == nil {
+		return nil
+	}
+	return p.BypassPullRequestAllowancesRequest
+}
+
 // GetDismissalRestrictionsRequest returns the DismissalRestrictionsRequest field.
 func (p *PullRequestReviewsEnforcementUpdate) GetDismissalRestrictionsRequest() *DismissalRestrictionsRequest {
 	if p == nil {
@@ -14822,6 +14878,14 @@ func (r *Repository) GetURL() string {
 	return *r.URL
 }
 
+// GetUseSquashPRTitleAsDefault returns the UseSquashPRTitleAsDefault field if it's non-nil, zero value otherwise.
+func (r *Repository) GetUseSquashPRTitleAsDefault() bool {
+	if r == nil || r.UseSquashPRTitleAsDefault == nil {
+		return false
+	}
+	return *r.UseSquashPRTitleAsDefault
+}
+
 // GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.
 func (r *Repository) GetVisibility() string {
 	if r == nil || r.Visibility == nil {
@@ -17262,6 +17326,22 @@ func (t *Tag) GetVerification() *SignatureVerification {
 	return t.Verification
 }
 
+// GetID returns the ID field if it's non-nil, zero value otherwise.
+func (t *TagProtection) GetID() int64 {
+	if t == nil || t.ID == nil {
+		return 0
+	}
+	return *t.ID
+}
+
+// GetPattern returns the Pattern field if it's non-nil, zero value otherwise.
+func (t *TagProtection) GetPattern() string {
+	if t == nil || t.Pattern == nil {
+		return ""
+	}
+	return *t.Pattern
+}
+
 // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.
 func (t *TaskStep) GetCompletedAt() Timestamp {
 	if t == nil || t.CompletedAt == nil {
diff --git a/github/issues.go b/github/issues.go
index 12488f98..351ec09c 100644
--- a/github/issues.go
+++ b/github/issues.go
@@ -77,13 +77,15 @@ func (i Issue) IsPullRequest() bool {
 // It is separate from Issue above because otherwise Labels
 // and Assignee fail to serialize to the correct JSON.
 type IssueRequest struct {
-	Title     *string   `json:"title,omitempty"`
-	Body      *string   `json:"body,omitempty"`
-	Labels    *[]string `json:"labels,omitempty"`
-	Assignee  *string   `json:"assignee,omitempty"`
-	State     *string   `json:"state,omitempty"`
-	Milestone *int      `json:"milestone,omitempty"`
-	Assignees *[]string `json:"assignees,omitempty"`
+	Title    *string   `json:"title,omitempty"`
+	Body     *string   `json:"body,omitempty"`
+	Labels   *[]string `json:"labels,omitempty"`
+	Assignee *string   `json:"assignee,omitempty"`
+	State    *string   `json:"state,omitempty"`
+	// StateReason can be 'completed' or 'not_planned'.
+	StateReason *string   `json:"state_reason,omitempty"`
+	Milestone   *int      `json:"milestone,omitempty"`
+	Assignees   *[]string `json:"assignees,omitempty"`
 }
 
 // IssueListOptions specifies the optional parameters to the IssuesService.List
diff --git a/github/orgs.go b/github/orgs.go
index 80979db3..26b55c62 100644
--- a/github/orgs.go
+++ b/github/orgs.go
@@ -65,6 +65,9 @@ type Organization struct {
 	MembersCanCreatePrivateRepos  *bool `json:"members_can_create_private_repositories,omitempty"`
 	MembersCanCreateInternalRepos *bool `json:"members_can_create_internal_repositories,omitempty"`
 
+	// MembersCanForkPrivateRepos toggles whether organization members can fork private organization repositories.
+	MembersCanForkPrivateRepos *bool `json:"members_can_fork_private_repositories,omitempty"`
+
 	// MembersAllowedRepositoryCreationType denotes if organization members can create repositories
 	// and the type of repositories they can create. Possible values are: "all", "private", or "none".
 	//
diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go
index 52bacfed..be5fd24d 100644
--- a/github/orgs_audit_log.go
+++ b/github/orgs_audit_log.go
@@ -70,6 +70,7 @@ type AuditEntry struct {
 	Repo                  *string     `json:"repo,omitempty"`
 	Repository            *string     `json:"repository,omitempty"`
 	RepositoryPublic      *bool       `json:"repository_public,omitempty"`
+	RunAttempt            *int64      `json:"run_attempt,omitempty"`
 	RunnerGroupID         *int64      `json:"runner_group_id,omitempty"`
 	RunnerGroupName       *string     `json:"runner_group_name,omitempty"`
 	RunnerID              *int64      `json:"runner_id,omitempty"`
diff --git a/github/repos.go b/github/repos.go
index c9bbe5a7..d5ac5112 100644
--- a/github/repos.go
+++ b/github/repos.go
@@ -26,52 +26,53 @@ type RepositoriesService service
 
 // Repository represents a GitHub repository.
 type Repository struct {
-	ID                  *int64          `json:"id,omitempty"`
-	NodeID              *string         `json:"node_id,omitempty"`
-	Owner               *User           `json:"owner,omitempty"`
-	Name                *string         `json:"name,omitempty"`
-	FullName            *string         `json:"full_name,omitempty"`
-	Description         *string         `json:"description,omitempty"`
-	Homepage            *string         `json:"homepage,omitempty"`
-	CodeOfConduct       *CodeOfConduct  `json:"code_of_conduct,omitempty"`
-	DefaultBranch       *string         `json:"default_branch,omitempty"`
-	MasterBranch        *string         `json:"master_branch,omitempty"`
-	CreatedAt           *Timestamp      `json:"created_at,omitempty"`
-	PushedAt            *Timestamp      `json:"pushed_at,omitempty"`
-	UpdatedAt           *Timestamp      `json:"updated_at,omitempty"`
-	HTMLURL             *string         `json:"html_url,omitempty"`
-	CloneURL            *string         `json:"clone_url,omitempty"`
-	GitURL              *string         `json:"git_url,omitempty"`
-	MirrorURL           *string         `json:"mirror_url,omitempty"`
-	SSHURL              *string         `json:"ssh_url,omitempty"`
-	SVNURL              *string         `json:"svn_url,omitempty"`
-	Language            *string         `json:"language,omitempty"`
-	Fork                *bool           `json:"fork,omitempty"`
-	ForksCount          *int            `json:"forks_count,omitempty"`
-	NetworkCount        *int            `json:"network_count,omitempty"`
-	OpenIssuesCount     *int            `json:"open_issues_count,omitempty"`
-	OpenIssues          *int            `json:"open_issues,omitempty"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated.
-	StargazersCount     *int            `json:"stargazers_count,omitempty"`
-	SubscribersCount    *int            `json:"subscribers_count,omitempty"`
-	WatchersCount       *int            `json:"watchers_count,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated.
-	Watchers            *int            `json:"watchers,omitempty"`       // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated.
-	Size                *int            `json:"size,omitempty"`
-	AutoInit            *bool           `json:"auto_init,omitempty"`
-	Parent              *Repository     `json:"parent,omitempty"`
-	Source              *Repository     `json:"source,omitempty"`
-	TemplateRepository  *Repository     `json:"template_repository,omitempty"`
-	Organization        *Organization   `json:"organization,omitempty"`
-	Permissions         map[string]bool `json:"permissions,omitempty"`
-	AllowRebaseMerge    *bool           `json:"allow_rebase_merge,omitempty"`
-	AllowUpdateBranch   *bool           `json:"allow_update_branch,omitempty"`
-	AllowSquashMerge    *bool           `json:"allow_squash_merge,omitempty"`
-	AllowMergeCommit    *bool           `json:"allow_merge_commit,omitempty"`
-	AllowAutoMerge      *bool           `json:"allow_auto_merge,omitempty"`
-	AllowForking        *bool           `json:"allow_forking,omitempty"`
-	DeleteBranchOnMerge *bool           `json:"delete_branch_on_merge,omitempty"`
-	Topics              []string        `json:"topics,omitempty"`
-	Archived            *bool           `json:"archived,omitempty"`
-	Disabled            *bool           `json:"disabled,omitempty"`
+	ID                        *int64          `json:"id,omitempty"`
+	NodeID                    *string         `json:"node_id,omitempty"`
+	Owner                     *User           `json:"owner,omitempty"`
+	Name                      *string         `json:"name,omitempty"`
+	FullName                  *string         `json:"full_name,omitempty"`
+	Description               *string         `json:"description,omitempty"`
+	Homepage                  *string         `json:"homepage,omitempty"`
+	CodeOfConduct             *CodeOfConduct  `json:"code_of_conduct,omitempty"`
+	DefaultBranch             *string         `json:"default_branch,omitempty"`
+	MasterBranch              *string         `json:"master_branch,omitempty"`
+	CreatedAt                 *Timestamp      `json:"created_at,omitempty"`
+	PushedAt                  *Timestamp      `json:"pushed_at,omitempty"`
+	UpdatedAt                 *Timestamp      `json:"updated_at,omitempty"`
+	HTMLURL                   *string         `json:"html_url,omitempty"`
+	CloneURL                  *string         `json:"clone_url,omitempty"`
+	GitURL                    *string         `json:"git_url,omitempty"`
+	MirrorURL                 *string         `json:"mirror_url,omitempty"`
+	SSHURL                    *string         `json:"ssh_url,omitempty"`
+	SVNURL                    *string         `json:"svn_url,omitempty"`
+	Language                  *string         `json:"language,omitempty"`
+	Fork                      *bool           `json:"fork,omitempty"`
+	ForksCount                *int            `json:"forks_count,omitempty"`
+	NetworkCount              *int            `json:"network_count,omitempty"`
+	OpenIssuesCount           *int            `json:"open_issues_count,omitempty"`
+	OpenIssues                *int            `json:"open_issues,omitempty"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated.
+	StargazersCount           *int            `json:"stargazers_count,omitempty"`
+	SubscribersCount          *int            `json:"subscribers_count,omitempty"`
+	WatchersCount             *int            `json:"watchers_count,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated.
+	Watchers                  *int            `json:"watchers,omitempty"`       // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated.
+	Size                      *int            `json:"size,omitempty"`
+	AutoInit                  *bool           `json:"auto_init,omitempty"`
+	Parent                    *Repository     `json:"parent,omitempty"`
+	Source                    *Repository     `json:"source,omitempty"`
+	TemplateRepository        *Repository     `json:"template_repository,omitempty"`
+	Organization              *Organization   `json:"organization,omitempty"`
+	Permissions               map[string]bool `json:"permissions,omitempty"`
+	AllowRebaseMerge          *bool           `json:"allow_rebase_merge,omitempty"`
+	AllowUpdateBranch         *bool           `json:"allow_update_branch,omitempty"`
+	AllowSquashMerge          *bool           `json:"allow_squash_merge,omitempty"`
+	AllowMergeCommit          *bool           `json:"allow_merge_commit,omitempty"`
+	AllowAutoMerge            *bool           `json:"allow_auto_merge,omitempty"`
+	AllowForking              *bool           `json:"allow_forking,omitempty"`
+	DeleteBranchOnMerge       *bool           `json:"delete_branch_on_merge,omitempty"`
+	UseSquashPRTitleAsDefault *bool           `json:"use_squash_pr_title_as_default,omitempty"`
+	Topics                    []string        `json:"topics,omitempty"`
+	Archived                  *bool           `json:"archived,omitempty"`
+	Disabled                  *bool           `json:"disabled,omitempty"`
 
 	// Only provided when using RepositoriesService.Get while in preview
 	License *License `json:"license,omitempty"`
@@ -362,16 +363,17 @@ type createRepoRequest struct {
 	// Creating an organization repository. Required for non-owners.
 	TeamID *int64 `json:"team_id,omitempty"`
 
-	AutoInit            *bool   `json:"auto_init,omitempty"`
-	GitignoreTemplate   *string `json:"gitignore_template,omitempty"`
-	LicenseTemplate     *string `json:"license_template,omitempty"`
-	AllowSquashMerge    *bool   `json:"allow_squash_merge,omitempty"`
-	AllowMergeCommit    *bool   `json:"allow_merge_commit,omitempty"`
-	AllowRebaseMerge    *bool   `json:"allow_rebase_merge,omitempty"`
-	AllowUpdateBranch   *bool   `json:"allow_update_branch,omitempty"`
-	AllowAutoMerge      *bool   `json:"allow_auto_merge,omitempty"`
-	AllowForking        *bool   `json:"allow_forking,omitempty"`
-	DeleteBranchOnMerge *bool   `json:"delete_branch_on_merge,omitempty"`
+	AutoInit                  *bool   `json:"auto_init,omitempty"`
+	GitignoreTemplate         *string `json:"gitignore_template,omitempty"`
+	LicenseTemplate           *string `json:"license_template,omitempty"`
+	AllowSquashMerge          *bool   `json:"allow_squash_merge,omitempty"`
+	AllowMergeCommit          *bool   `json:"allow_merge_commit,omitempty"`
+	AllowRebaseMerge          *bool   `json:"allow_rebase_merge,omitempty"`
+	AllowUpdateBranch         *bool   `json:"allow_update_branch,omitempty"`
+	AllowAutoMerge            *bool   `json:"allow_auto_merge,omitempty"`
+	AllowForking              *bool   `json:"allow_forking,omitempty"`
+	DeleteBranchOnMerge       *bool   `json:"delete_branch_on_merge,omitempty"`
+	UseSquashPRTitleAsDefault *bool   `json:"use_squash_pr_title_as_default,omitempty"`
 }
 
 // Create a new repository. If an organization is specified, the new
@@ -397,26 +399,27 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo
 	}
 
 	repoReq := &createRepoRequest{
-		Name:                repo.Name,
-		Description:         repo.Description,
-		Homepage:            repo.Homepage,
-		Private:             repo.Private,
-		Visibility:          repo.Visibility,
-		HasIssues:           repo.HasIssues,
-		HasProjects:         repo.HasProjects,
-		HasWiki:             repo.HasWiki,
-		IsTemplate:          repo.IsTemplate,
-		TeamID:              repo.TeamID,
-		AutoInit:            repo.AutoInit,
-		GitignoreTemplate:   repo.GitignoreTemplate,
-		LicenseTemplate:     repo.LicenseTemplate,
-		AllowSquashMerge:    repo.AllowSquashMerge,
-		AllowMergeCommit:    repo.AllowMergeCommit,
-		AllowRebaseMerge:    repo.AllowRebaseMerge,
-		AllowUpdateBranch:   repo.AllowUpdateBranch,
-		AllowAutoMerge:      repo.AllowAutoMerge,
-		AllowForking:        repo.AllowForking,
-		DeleteBranchOnMerge: repo.DeleteBranchOnMerge,
+		Name:                      repo.Name,
+		Description:               repo.Description,
+		Homepage:                  repo.Homepage,
+		Private:                   repo.Private,
+		Visibility:                repo.Visibility,
+		HasIssues:                 repo.HasIssues,
+		HasProjects:               repo.HasProjects,
+		HasWiki:                   repo.HasWiki,
+		IsTemplate:                repo.IsTemplate,
+		TeamID:                    repo.TeamID,
+		AutoInit:                  repo.AutoInit,
+		GitignoreTemplate:         repo.GitignoreTemplate,
+		LicenseTemplate:           repo.LicenseTemplate,
+		AllowSquashMerge:          repo.AllowSquashMerge,
+		AllowMergeCommit:          repo.AllowMergeCommit,
+		AllowRebaseMerge:          repo.AllowRebaseMerge,
+		AllowUpdateBranch:         repo.AllowUpdateBranch,
+		AllowAutoMerge:            repo.AllowAutoMerge,
+		AllowForking:              repo.AllowForking,
+		DeleteBranchOnMerge:       repo.DeleteBranchOnMerge,
+		UseSquashPRTitleAsDefault: repo.UseSquashPRTitleAsDefault,
 	}
 
 	req, err := s.client.NewRequest("POST", u, repoReq)
@@ -916,6 +919,8 @@ type RequiredStatusCheck struct {
 
 // PullRequestReviewsEnforcement represents the pull request reviews enforcement of a protected branch.
 type PullRequestReviewsEnforcement struct {
+	// Allow specific users, teams, or apps to bypass pull request requirements.
+	BypassPullRequestAllowances *BypassPullRequestAllowances `json:"bypass_pull_request_allowances,omitempty"`
 	// Specifies which users and teams can dismiss pull request reviews.
 	DismissalRestrictions *DismissalRestrictions `json:"dismissal_restrictions,omitempty"`
 	// Specifies if approved reviews are dismissed automatically, when a new commit is pushed.
@@ -931,6 +936,8 @@ type PullRequestReviewsEnforcement struct {
 // enforcement of a protected branch. It is separate from PullRequestReviewsEnforcement above
 // because the request structure is different from the response structure.
 type PullRequestReviewsEnforcementRequest struct {
+	// Allow specific users, teams, or apps to bypass pull request requirements.
+	BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"`
 	// Specifies which users and teams should be allowed to dismiss pull request reviews.
 	// User and team dismissal restrictions are only available for
 	// organization-owned repositories. Must be nil for personal repositories.
@@ -948,6 +955,8 @@ type PullRequestReviewsEnforcementRequest struct {
 // enforcement of a protected branch. It is separate from PullRequestReviewsEnforcementRequest above
 // because the patch request does not require all fields to be initialized.
 type PullRequestReviewsEnforcementUpdate struct {
+	// Allow specific users, teams, or apps to bypass pull request requirements.
+	BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"`
 	// Specifies which users and teams can dismiss pull request reviews. Can be omitted.
 	DismissalRestrictionsRequest *DismissalRestrictionsRequest `json:"dismissal_restrictions,omitempty"`
 	// Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. Can be omitted.
@@ -1009,6 +1018,29 @@ type BranchRestrictionsRequest struct {
 	Apps []string `json:"apps,omitempty"`
 }
 
+// BypassPullRequestAllowances represents the people, teams, or apps who are allowed to bypass required pull requests.
+type BypassPullRequestAllowances struct {
+	// The list of users allowed to bypass pull request requirements.
+	Users []*User `json:"users"`
+	// The list of teams allowed to bypass pull request requirements.
+	Teams []*Team `json:"teams"`
+	// The list of apps allowed to bypass pull request requirements.
+	Apps []*App `json:"apps"`
+}
+
+// BypassPullRequestAllowancesRequest represents the people, teams, or apps who are
+// allowed to bypass required pull requests.
+// It is separate from BypassPullRequestAllowances above because the request structure is
+// different from the response structure.
+type BypassPullRequestAllowancesRequest struct {
+	// The list of user logins allowed to bypass pull request requirements.
+	Users []string `json:"users"`
+	// The list of team slugs allowed to bypass pull request requirements.
+	Teams []string `json:"teams"`
+	// The list of app slugs allowed to bypass pull request requirements.
+	Apps []string `json:"apps"`
+}
+
 // DismissalRestrictions specifies which users and teams can dismiss pull request reviews.
 type DismissalRestrictions struct {
 	// The list of users who can dimiss pull request reviews.
diff --git a/github/repos_codeowners.go b/github/repos_codeowners.go
new file mode 100644
index 00000000..835d56e1
--- /dev/null
+++ b/github/repos_codeowners.go
@@ -0,0 +1,46 @@
+// Copyright 2022 The go-github AUTHORS. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package github
+
+import (
+	"context"
+	"fmt"
+)
+
+// CodeownersErrors represents a list of syntax errors detected in the CODEOWNERS file.
+type CodeownersErrors struct {
+	Errors []*CodeownersError `json:"errors"`
+}
+
+// CodeownersError represents a syntax error detected in the CODEOWNERS file.
+type CodeownersError struct {
+	Line       int     `json:"line"`
+	Column     int     `json:"column"`
+	Kind       string  `json:"kind"`
+	Source     string  `json:"source"`
+	Suggestion *string `json:"suggestion,omitempty"`
+	Message    string  `json:"message"`
+	Path       string  `json:"path"`
+}
+
+// GetCodeownersErrors lists any syntax errors that are detected in the CODEOWNERS file.
+//
+// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-codeowners-errors
+func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string) (*CodeownersErrors, *Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/codeowners/errors", owner, repo)
+	req, err := s.client.NewRequest("GET", u, nil)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	codeownersErrors := &CodeownersErrors{}
+	resp, err := s.client.Do(ctx, req, codeownersErrors)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return codeownersErrors, resp, nil
+}
diff --git a/github/repos_contents.go b/github/repos_contents.go
index d6f2dd9d..431d4b12 100644
--- a/github/repos_contents.go
+++ b/github/repos_contents.go
@@ -51,7 +51,7 @@ type RepositoryContentResponse struct {
 // RepositoryContentFileOptions specifies optional parameters for CreateFile, UpdateFile, and DeleteFile.
 type RepositoryContentFileOptions struct {
 	Message   *string       `json:"message,omitempty"`
-	Content   []byte        `json:"content,omitempty"` // unencoded
+	Content   []byte        `json:"content"` // unencoded
 	SHA       *string       `json:"sha,omitempty"`
 	Branch    *string       `json:"branch,omitempty"`
 	Author    *CommitAuthor `json:"author,omitempty"`
diff --git a/github/repos_lfs.go b/github/repos_lfs.go
new file mode 100644
index 00000000..6ac2e5a8
--- /dev/null
+++ b/github/repos_lfs.go
@@ -0,0 +1,49 @@
+// Copyright 2022 The go-github AUTHORS. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package github
+
+import (
+	"context"
+	"fmt"
+)
+
+// EnableLFS turns the LFS (Large File Storage) feature ON for the selected repo.
+//
+// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#enable-git-lfs-for-a-repository
+func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo)
+
+	req, err := s.client.NewRequest("PUT", u, nil)
+	if err != nil {
+		return nil, err
+	}
+
+	resp, err := s.client.Do(ctx, req, nil)
+	if err != nil {
+		return resp, err
+	}
+
+	return resp, nil
+}
+
+// DisableLFS turns the LFS (Large File Storage) feature OFF for the selected repo.
+//
+// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#disable-git-lfs-for-a-repository
+func (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo)
+
+	req, err := s.client.NewRequest("DELETE", u, nil)
+	if err != nil {
+		return nil, err
+	}
+
+	resp, err := s.client.Do(ctx, req, nil)
+	if err != nil {
+		return resp, err
+	}
+
+	return resp, nil
+}
diff --git a/github/repos_pages.go b/github/repos_pages.go
index 9b864eb0..737cec0f 100644
--- a/github/repos_pages.go
+++ b/github/repos_pages.go
@@ -93,8 +93,10 @@ type PagesUpdate struct {
 	// Leaving CNAME empty will remove the custom domain.
 	CNAME *string `json:"cname"`
 	// Source must include the branch name, and may optionally specify the subdirectory "/docs".
-	// Possible values are: "gh-pages", "master", and "master /docs".
-	Source *string `json:"source,omitempty"`
+	// Possible values for Source.Branch are usually "gh-pages", "main", and "master",
+	// or any other existing branch name.
+	// Possible values for Source.Path are: "/", and "/docs".
+	Source *PagesSource `json:"source,omitempty"`
 	// Public configures access controls for the site.
 	// If "true", the site will be accessible to anyone on the internet. If "false",
 	// the site will be accessible to anyone with read access to the repository that
diff --git a/github/repos_tags.go b/github/repos_tags.go
new file mode 100644
index 00000000..ff46d90c
--- /dev/null
+++ b/github/repos_tags.go
@@ -0,0 +1,76 @@
+// Copyright 2022 The go-github AUTHORS. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package github
+
+import (
+	"context"
+	"fmt"
+)
+
+// TagProtection represents a repository tag protection.
+type TagProtection struct {
+	ID      *int64  `json:"id"`
+	Pattern *string `json:"pattern"`
+}
+
+// tagProtectionRequest represents a request to create tag protection.
+type tagProtectionRequest struct {
+	// An optional glob pattern to match against when enforcing tag protection.
+	Pattern string `json:"pattern"`
+}
+
+// ListTagProtection lists tag protection of the specified repository.
+//
+// GitHub API docs: https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository
+func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo)
+
+	req, err := s.client.NewRequest("GET", u, nil)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	var tagProtections []*TagProtection
+	resp, err := s.client.Do(ctx, req, &tagProtections)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return tagProtections, resp, nil
+}
+
+// CreateTagProtection creates the tag protection of the specified repository.
+//
+// GitHub API docs: https://docs.github.com/en/rest/repos/tags#create-a-tag-protection-state-for-a-repository
+func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo)
+	r := &tagProtectionRequest{Pattern: pattern}
+	req, err := s.client.NewRequest("POST", u, r)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	tagProtection := new(TagProtection)
+	resp, err := s.client.Do(ctx, req, tagProtection)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return tagProtection, resp, nil
+}
+
+// DeleteTagProtection deletes a tag protection from the specified repository.
+//
+// GitHub API docs: https://docs.github.com/en/rest/repos/tags#delete-a-tag-protection-state-for-a-repository
+func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/tags/protection/%v", owner, repo, tagProtectionID)
+	req, err := s.client.NewRequest("DELETE", u, nil)
+	if err != nil {
+		return nil, err
+	}
+
+	return s.client.Do(ctx, req, nil)
+}
diff --git a/github/search.go b/github/search.go
index 344f1bb9..4d166640 100644
--- a/github/search.go
+++ b/github/search.go
@@ -9,6 +9,7 @@ import (
 	"context"
 	"fmt"
 	"strconv"
+	"strings"
 
 	qs "github.com/google/go-querystring/query"
 )
@@ -299,29 +300,32 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter
 	if err != nil {
 		return nil, err
 	}
-
+	var acceptHeaders []string
 	switch {
 	case searchType == "commits":
 		// Accept header for search commits preview endpoint
 		// TODO: remove custom Accept header when this API fully launches.
-		req.Header.Set("Accept", mediaTypeCommitSearchPreview)
+		acceptHeaders = append(acceptHeaders, mediaTypeCommitSearchPreview)
 	case searchType == "topics":
 		// Accept header for search repositories based on topics preview endpoint
 		// TODO: remove custom Accept header when this API fully launches.
-		req.Header.Set("Accept", mediaTypeTopicsPreview)
+		acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview)
 	case searchType == "repositories":
 		// Accept header for search repositories based on topics preview endpoint
 		// TODO: remove custom Accept header when this API fully launches.
-		req.Header.Set("Accept", mediaTypeTopicsPreview)
+		acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview)
 	case searchType == "issues":
 		// Accept header for search issues based on reactions preview endpoint
 		// TODO: remove custom Accept header when this API fully launches.
-		req.Header.Set("Accept", mediaTypeReactionsPreview)
-	case opts != nil && opts.TextMatch:
-		// Accept header defaults to "application/vnd.github.v3+json"
-		// We change it here to fetch back text-match metadata
-		req.Header.Set("Accept", "application/vnd.github.v3.text-match+json")
+		acceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview)
+	}
+	// https://docs.github.com/en/rest/search#search-repositories
+	// Accept header defaults to "application/vnd.github.v3+json"
+	// We change it here to fetch back text-match metadata
+	if opts != nil && opts.TextMatch {
+		acceptHeaders = append(acceptHeaders, "application/vnd.github.v3.text-match+json")
 	}
+	req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
 
 	return s.client.Do(ctx, req, result)
 }
diff --git a/scrape/go.mod b/scrape/go.mod
index f45b2178..e2c02f00 100644
--- a/scrape/go.mod
+++ b/scrape/go.mod
@@ -5,7 +5,7 @@ go 1.13
 require (
 	github.com/PuerkitoBio/goquery v1.8.0
 	github.com/google/go-cmp v0.5.8
-	github.com/google/go-github/v45 v45.1.0
+	github.com/google/go-github/v45 v45.2.0
 	github.com/xlzd/gotp v0.0.0-20181030022105-c8557ba2c119
 	golang.org/x/net v0.0.0-20210916014120-12bc252f5db8
 )
diff --git a/scrape/go.sum b/scrape/go.sum
index 0a6015df..3c105db4 100644
--- a/scrape/go.sum
+++ b/scrape/go.sum
@@ -7,8 +7,8 @@ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
 github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/go-github/v45 v45.1.0 h1:SbUjHMRiCe9cHfu6Me4idWxLQEV8ZW9DLPz69zopyWo=
-github.com/google/go-github/v45 v45.1.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28=
+github.com/google/go-github/v45 v45.2.0 h1:5oRLszbrkvxDDqBCNj2hjDZMKmvexaZ1xw/FCD+K3FI=
+github.com/google/go-github/v45 v45.2.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28=
 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=


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index c43bda38..b62f175b 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -36,7 +36,7 @@ jobs:
 
     steps:
     - name: Cancel previous
-      uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b #0.9.1
+      uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 #0.10.0
       with:
         access_token: ${{ github.token }}
 
diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go
index d22b8a52..2705363b 100644
--- a/github/actions_workflow_runs_test.go
+++ b/github/actions_workflow_runs_test.go
@@ -7,6 +7,7 @@ package github
 
 import (
 	"context"
+	"encoding/json"
 	"fmt"
 	"net/http"
 	"net/url"
@@ -1075,3 +1076,47 @@ func TestWorkflowRunUsage_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, u, want)
 }
+
+func TestActionService_PendingDeployments(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	input := &PendingDeploymentsRequest{EnvironmentIDs: []int64{3, 4}, State: "approved", Comment: ""}
+
+	mux.HandleFunc("/repos/o/r/actions/runs/399444496/pending_deployments", func(w http.ResponseWriter, r *http.Request) {
+		v := new(PendingDeploymentsRequest)
+		json.NewDecoder(r.Body).Decode(v)
+
+		testMethod(t, r, "POST")
+		if !cmp.Equal(v, input) {
+			t.Errorf("Request body = %+v, want %+v", v, input)
+		}
+
+		fmt.Fprint(w, `[{"id":1}, {"id":2}]`)
+	})
+
+	ctx := context.Background()
+	deployments, _, err := client.Actions.PendingDeployments(ctx, "o", "r", 399444496, input)
+	if err != nil {
+		t.Errorf("Actions.PendingDeployments returned error: %v", err)
+	}
+
+	want := []*Deployment{{ID: Int64(1)}, {ID: Int64(2)}}
+	if !cmp.Equal(deployments, want) {
+		t.Errorf("Actions.PendingDeployments returned %+v, want %+v", deployments, want)
+	}
+
+	const methodName = "PendingDeployments"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.Actions.PendingDeployments(ctx, "\n", "\n", 399444496, input)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Actions.PendingDeployments(ctx, "o", "r", 399444496, input)
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index 27ad0c81..984a69b7 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -1216,6 +1216,16 @@ func TestAuditEntry_GetRepositoryPublic(tt *testing.T) {
 	a.GetRepositoryPublic()
 }
 
+func TestAuditEntry_GetRunAttempt(tt *testing.T) {
+	var zeroValue int64
+	a := &AuditEntry{RunAttempt: &zeroValue}
+	a.GetRunAttempt()
+	a = &AuditEntry{}
+	a.GetRunAttempt()
+	a = nil
+	a.GetRunAttempt()
+}
+
 func TestAuditEntry_GetRunnerGroupID(tt *testing.T) {
 	var zeroValue int64
 	a := &AuditEntry{RunnerGroupID: &zeroValue}
@@ -2699,6 +2709,16 @@ func TestCodeOfConduct_GetURL(tt *testing.T) {
 	c.GetURL()
 }
 
+func TestCodeownersError_GetSuggestion(tt *testing.T) {
+	var zeroValue string
+	c := &CodeownersError{Suggestion: &zeroValue}
+	c.GetSuggestion()
+	c = &CodeownersError{}
+	c.GetSuggestion()
+	c = nil
+	c.GetSuggestion()
+}
+
 func TestCodeResult_GetHTMLURL(tt *testing.T) {
 	var zeroValue string
 	c := &CodeResult{HTMLURL: &zeroValue}
@@ -8938,6 +8958,16 @@ func TestIssueRequest_GetState(tt *testing.T) {
 	i.GetState()
 }
 
+func TestIssueRequest_GetStateReason(tt *testing.T) {
+	var zeroValue string
+	i := &IssueRequest{StateReason: &zeroValue}
+	i.GetStateReason()
+	i = &IssueRequest{}
+	i.GetStateReason()
+	i = nil
+	i.GetStateReason()
+}
+
 func TestIssueRequest_GetTitle(tt *testing.T) {
 	var zeroValue string
 	i := &IssueRequest{Title: &zeroValue}
@@ -11281,6 +11311,16 @@ func TestOrganization_GetMembersCanCreateRepos(tt *testing.T) {
 	o.GetMembersCanCreateRepos()
 }
 
+func TestOrganization_GetMembersCanForkPrivateRepos(tt *testing.T) {
+	var zeroValue bool
+	o := &Organization{MembersCanForkPrivateRepos: &zeroValue}
+	o.GetMembersCanForkPrivateRepos()
+	o = &Organization{}
+	o.GetMembersCanForkPrivateRepos()
+	o = nil
+	o.GetMembersCanForkPrivateRepos()
+}
+
 func TestOrganization_GetMembersURL(tt *testing.T) {
 	var zeroValue string
 	o := &Organization{MembersURL: &zeroValue}
@@ -12623,10 +12663,7 @@ func TestPagesUpdate_GetPublic(tt *testing.T) {
 }
 
 func TestPagesUpdate_GetSource(tt *testing.T) {
-	var zeroValue string
-	p := &PagesUpdate{Source: &zeroValue}
-	p.GetSource()
-	p = &PagesUpdate{}
+	p := &PagesUpdate{}
 	p.GetSource()
 	p = nil
 	p.GetSource()
@@ -14982,6 +15019,13 @@ func TestPullRequestReviewRequest_GetNodeID(tt *testing.T) {
 	p.GetNodeID()
 }
 
+func TestPullRequestReviewsEnforcement_GetBypassPullRequestAllowances(tt *testing.T) {
+	p := &PullRequestReviewsEnforcement{}
+	p.GetBypassPullRequestAllowances()
+	p = nil
+	p.GetBypassPullRequestAllowances()
+}
+
 func TestPullRequestReviewsEnforcement_GetDismissalRestrictions(tt *testing.T) {
 	p := &PullRequestReviewsEnforcement{}
 	p.GetDismissalRestrictions()
@@ -14989,6 +15033,13 @@ func TestPullRequestReviewsEnforcement_GetDismissalRestrictions(tt *testing.T) {
 	p.GetDismissalRestrictions()
 }
 
+func TestPullRequestReviewsEnforcementRequest_GetBypassPullRequestAllowancesRequest(tt *testing.T) {
+	p := &PullRequestReviewsEnforcementRequest{}
+	p.GetBypassPullRequestAllowancesRequest()
+	p = nil
+	p.GetBypassPullRequestAllowancesRequest()
+}
+
 func TestPullRequestReviewsEnforcementRequest_GetDismissalRestrictionsRequest(tt *testing.T) {
 	p := &PullRequestReviewsEnforcementRequest{}
 	p.GetDismissalRestrictionsRequest()
@@ -14996,6 +15047,13 @@ func TestPullRequestReviewsEnforcementRequest_GetDismissalRestrictionsRequest(tt
 	p.GetDismissalRestrictionsRequest()
 }
 
+func TestPullRequestReviewsEnforcementUpdate_GetBypassPullRequestAllowancesRequest(tt *testing.T) {
+	p := &PullRequestReviewsEnforcementUpdate{}
+	p.GetBypassPullRequestAllowancesRequest()
+	p = nil
+	p.GetBypassPullRequestAllowancesRequest()
+}
+
 func TestPullRequestReviewsEnforcementUpdate_GetDismissalRestrictionsRequest(tt *testing.T) {
 	p := &PullRequestReviewsEnforcementUpdate{}
 	p.GetDismissalRestrictionsRequest()
@@ -17268,6 +17326,16 @@ func TestRepository_GetURL(tt *testing.T) {
 	r.GetURL()
 }
 
+func TestRepository_GetUseSquashPRTitleAsDefault(tt *testing.T) {
+	var zeroValue bool
+	r := &Repository{UseSquashPRTitleAsDefault: &zeroValue}
+	r.GetUseSquashPRTitleAsDefault()
+	r = &Repository{}
+	r.GetUseSquashPRTitleAsDefault()
+	r = nil
+	r.GetUseSquashPRTitleAsDefault()
+}
+
 func TestRepository_GetVisibility(tt *testing.T) {
 	var zeroValue string
 	r := &Repository{Visibility: &zeroValue}
@@ -20135,6 +20203,26 @@ func TestTag_GetVerification(tt *testing.T) {
 	t.GetVerification()
 }
 
+func TestTagProtection_GetID(tt *testing.T) {
+	var zeroValue int64
+	t := &TagProtection{ID: &zeroValue}
+	t.GetID()
+	t = &TagProtection{}
+	t.GetID()
+	t = nil
+	t.GetID()
+}
+
+func TestTagProtection_GetPattern(tt *testing.T) {
+	var zeroValue string
+	t := &TagProtection{Pattern: &zeroValue}
+	t.GetPattern()
+	t = &TagProtection{}
+	t.GetPattern()
+	t = nil
+	t.GetPattern()
+}
+
 func TestTaskStep_GetCompletedAt(tt *testing.T) {
 	var zeroValue Timestamp
 	t := &TaskStep{CompletedAt: &zeroValue}
diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go
index fa7599d3..d056c680 100644
--- a/github/github-stringify_test.go
+++ b/github/github-stringify_test.go
@@ -992,6 +992,7 @@ func TestOrganization_String(t *testing.T) {
 		MembersCanCreatePublicRepos:          Bool(false),
 		MembersCanCreatePrivateRepos:         Bool(false),
 		MembersCanCreateInternalRepos:        Bool(false),
+		MembersCanForkPrivateRepos:           Bool(false),
 		MembersAllowedRepositoryCreationType: String(""),
 		MembersCanCreatePages:                Bool(false),
 		MembersCanCreatePublicPages:          Bool(false),
@@ -1004,7 +1005,7 @@ func TestOrganization_String(t *testing.T) {
 		PublicMembersURL:                     String(""),
 		ReposURL:                             String(""),
 	}
-	want := `github.Organization{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", Name:"", Company:"", Blog:"", Location:"", Email:"", TwitterUsername:"", Description:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, BillingEmail:"", Type:"", Plan:github.Plan{}, TwoFactorRequirementEnabled:false, IsVerified:false, HasOrganizationProjects:false, HasRepositoryProjects:false, DefaultRepoPermission:"", DefaultRepoSettings:"", MembersCanCreateRepos:false, MembersCanCreatePublicRepos:false, MembersCanCreatePrivateRepos:false, MembersCanCreateInternalRepos:false, MembersAllowedRepositoryCreationType:"", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}`
+	want := `github.Organization{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", Name:"", Company:"", Blog:"", Location:"", Email:"", TwitterUsername:"", Description:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, BillingEmail:"", Type:"", Plan:github.Plan{}, TwoFactorRequirementEnabled:false, IsVerified:false, HasOrganizationProjects:false, HasRepositoryProjects:false, DefaultRepoPermission:"", DefaultRepoSettings:"", MembersCanCreateRepos:false, MembersCanCreatePublicRepos:false, MembersCanCreatePrivateRepos:false, MembersCanCreateInternalRepos:false, MembersCanForkPrivateRepos:false, MembersAllowedRepositoryCreationType:"", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, URL:"", EventsURL:"", HooksURL:"", IssuesURL:"", MembersURL:"", PublicMembersURL:"", ReposURL:""}`
 	if got := v.String(); got != want {
 		t.Errorf("Organization.String = %v, want %v", got, want)
 	}
@@ -1480,104 +1481,105 @@ func TestRepoStatus_String(t *testing.T) {
 
 func TestRepository_String(t *testing.T) {
 	v := Repository{
-		ID:                  Int64(0),
-		NodeID:              String(""),
-		Owner:               &User{},
-		Name:                String(""),
-		FullName:            String(""),
-		Description:         String(""),
-		Homepage:            String(""),
-		CodeOfConduct:       &CodeOfConduct{},
-		DefaultBranch:       String(""),
-		MasterBranch:        String(""),
-		CreatedAt:           &Timestamp{},
-		PushedAt:            &Timestamp{},
-		UpdatedAt:           &Timestamp{},
-		HTMLURL:             String(""),
-		CloneURL:            String(""),
-		GitURL:              String(""),
-		MirrorURL:           String(""),
-		SSHURL:              String(""),
-		SVNURL:              String(""),
-		Language:            String(""),
-		Fork:                Bool(false),
-		ForksCount:          Int(0),
-		NetworkCount:        Int(0),
-		OpenIssuesCount:     Int(0),
-		OpenIssues:          Int(0),
-		StargazersCount:     Int(0),
-		SubscribersCount:    Int(0),
-		WatchersCount:       Int(0),
-		Watchers:            Int(0),
-		Size:                Int(0),
-		AutoInit:            Bool(false),
-		Parent:              &Repository{},
-		Source:              &Repository{},
-		TemplateRepository:  &Repository{},
-		Organization:        &Organization{},
-		AllowRebaseMerge:    Bool(false),
-		AllowUpdateBranch:   Bool(false),
-		AllowSquashMerge:    Bool(false),
-		AllowMergeCommit:    Bool(false),
-		AllowAutoMerge:      Bool(false),
-		AllowForking:        Bool(false),
-		DeleteBranchOnMerge: Bool(false),
-		Topics:              []string{""},
-		Archived:            Bool(false),
-		Disabled:            Bool(false),
-		License:             &License{},
-		Private:             Bool(false),
-		HasIssues:           Bool(false),
-		HasWiki:             Bool(false),
-		HasPages:            Bool(false),
-		HasProjects:         Bool(false),
-		HasDownloads:        Bool(false),
-		IsTemplate:          Bool(false),
-		LicenseTemplate:     String(""),
-		GitignoreTemplate:   String(""),
-		SecurityAndAnalysis: &SecurityAndAnalysis{},
-		TeamID:              Int64(0),
-		URL:                 String(""),
-		ArchiveURL:          String(""),
-		AssigneesURL:        String(""),
-		BlobsURL:            String(""),
-		BranchesURL:         String(""),
-		CollaboratorsURL:    String(""),
-		CommentsURL:         String(""),
-		CommitsURL:          String(""),
-		CompareURL:          String(""),
-		ContentsURL:         String(""),
-		ContributorsURL:     String(""),
-		DeploymentsURL:      String(""),
-		DownloadsURL:        String(""),
-		EventsURL:           String(""),
-		ForksURL:            String(""),
-		GitCommitsURL:       String(""),
-		GitRefsURL:          String(""),
-		GitTagsURL:          String(""),
-		HooksURL:            String(""),
-		IssueCommentURL:     String(""),
-		IssueEventsURL:      String(""),
-		IssuesURL:           String(""),
-		KeysURL:             String(""),
-		LabelsURL:           String(""),
-		LanguagesURL:        String(""),
-		MergesURL:           String(""),
-		MilestonesURL:       String(""),
-		NotificationsURL:    String(""),
-		PullsURL:            String(""),
-		ReleasesURL:         String(""),
-		StargazersURL:       String(""),
-		StatusesURL:         String(""),
-		SubscribersURL:      String(""),
-		SubscriptionURL:     String(""),
-		TagsURL:             String(""),
-		TreesURL:            String(""),
-		TeamsURL:            String(""),
-		Visibility:          String(""),
-		RoleName:            String(""),
-	}
-	want := `github.Repository{ID:0, NodeID:"", Owner:github.User{}, Name:"", FullName:"", Description:"", Homepage:"", CodeOfConduct:github.CodeOfConduct{}, DefaultBranch:"", MasterBranch:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, PushedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, HTMLURL:"", CloneURL:"", GitURL:"", MirrorURL:"", SSHURL:"", SVNURL:"", Language:"", Fork:false, ForksCount:0, NetworkCount:0, OpenIssuesCount:0, OpenIssues:0, StargazersCount:0, SubscribersCount:0, WatchersCount:0, Watchers:0, Size:0, AutoInit:false, Parent:github.Repository{}, Source:github.Repository{}, TemplateRepository:github.Repository{}, Organization:github.Organization{}, AllowRebaseMerge:false, AllowUpdateBranch:false, AllowSquashMerge:false, AllowMergeCommit:false, AllowAutoMerge:false, AllowForking:false, DeleteBranchOnMerge:false, Topics:[""], Archived:false, Disabled:false, License:github.License{}, Private:false, HasIssues:false, HasWiki:false, HasPages:false, HasProjects:false, HasDownloads:false, IsTemplate:false, LicenseTemplate:"", GitignoreTemplate:"", SecurityAndAnalysis:github.SecurityAndAnalysis{}, TeamID:0, URL:"", ArchiveURL:"", AssigneesURL:"", BlobsURL:"", BranchesURL:"", CollaboratorsURL:"", CommentsURL:"", CommitsURL:"", CompareURL:"", ContentsURL:"", ContributorsURL:"", DeploymentsURL:"", DownloadsURL:"", EventsURL:"", ForksURL:"", GitCommitsURL:"", GitRefsURL:"", GitTagsURL:"", HooksURL:"", IssueCommentURL:"", IssueEventsURL:"", IssuesURL:"", KeysURL:"", LabelsURL:"", LanguagesURL:"", MergesURL:"", MilestonesURL:"", NotificationsURL:"", PullsURL:"", ReleasesURL:"", StargazersURL:"", StatusesURL:"", SubscribersURL:"", SubscriptionURL:"", TagsURL:"", TreesURL:"", TeamsURL:"", Visibility:"", RoleName:""}`
+		ID:                        Int64(0),
+		NodeID:                    String(""),
+		Owner:                     &User{},
+		Name:                      String(""),
+		FullName:                  String(""),
+		Description:               String(""),
+		Homepage:                  String(""),
+		CodeOfConduct:             &CodeOfConduct{},
+		DefaultBranch:             String(""),
+		MasterBranch:              String(""),
+		CreatedAt:                 &Timestamp{},
+		PushedAt:                  &Timestamp{},
+		UpdatedAt:                 &Timestamp{},
+		HTMLURL:                   String(""),
+		CloneURL:                  String(""),
+		GitURL:                    String(""),
+		MirrorURL:                 String(""),
+		SSHURL:                    String(""),
+		SVNURL:                    String(""),
+		Language:                  String(""),
+		Fork:                      Bool(false),
+		ForksCount:                Int(0),
+		NetworkCount:              Int(0),
+		OpenIssuesCount:           Int(0),
+		OpenIssues:                Int(0),
+		StargazersCount:           Int(0),
+		SubscribersCount:          Int(0),
+		WatchersCount:             Int(0),
+		Watchers:                  Int(0),
+		Size:                      Int(0),
+		AutoInit:                  Bool(false),
+		Parent:                    &Repository{},
+		Source:                    &Repository{},
+		TemplateRepository:        &Repository{},
+		Organization:              &Organization{},
+		AllowRebaseMerge:          Bool(false),
+		AllowUpdateBranch:         Bool(false),
+		AllowSquashMerge:          Bool(false),
+		AllowMergeCommit:          Bool(false),
+		AllowAutoMerge:            Bool(false),
+		AllowForking:              Bool(false),
+		DeleteBranchOnMerge:       Bool(false),
+		UseSquashPRTitleAsDefault: Bool(false),
+		Topics:                    []string{""},
+		Archived:                  Bool(false),
+		Disabled:                  Bool(false),
+		License:                   &License{},
+		Private:                   Bool(false),
+		HasIssues:                 Bool(false),
+		HasWiki:                   Bool(false),
+		HasPages:                  Bool(false),
+		HasProjects:               Bool(false),
+		HasDownloads:              Bool(false),
+		IsTemplate:                Bool(false),
+		LicenseTemplate:           String(""),
+		GitignoreTemplate:         String(""),
+		SecurityAndAnalysis:       &SecurityAndAnalysis{},
+		TeamID:                    Int64(0),
+		URL:                       String(""),
+		ArchiveURL:                String(""),
+		AssigneesURL:              String(""),
+		BlobsURL:                  String(""),
+		BranchesURL:               String(""),
+		CollaboratorsURL:          String(""),
+		CommentsURL:               String(""),
+		CommitsURL:                String(""),
+		CompareURL:                String(""),
+		ContentsURL:               String(""),
+		ContributorsURL:           String(""),
+		DeploymentsURL:            String(""),
+		DownloadsURL:              String(""),
+		EventsURL:                 String(""),
+		ForksURL:                  String(""),
+		GitCommitsURL:             String(""),
+		GitRefsURL:                String(""),
+		GitTagsURL:                String(""),
+		HooksURL:                  String(""),
+		IssueCommentURL:           String(""),
+		IssueEventsURL:            String(""),
+		IssuesURL:                 String(""),
+		KeysURL:                   String(""),
+		LabelsURL:                 String(""),
+		LanguagesURL:              String(""),
+		MergesURL:                 String(""),
+		MilestonesURL:             String(""),
+		NotificationsURL:          String(""),
+		PullsURL:                  String(""),
+		ReleasesURL:               String(""),
+		StargazersURL:             String(""),
+		StatusesURL:               String(""),
+		SubscribersURL:            String(""),
+		SubscriptionURL:           String(""),
+		TagsURL:                   String(""),
+		TreesURL:                  String(""),
+		TeamsURL:                  String(""),
+		Visibility:                String(""),
+		RoleName:                  String(""),
+	}
+	want := `github.Repository{ID:0, NodeID:"", Owner:github.User{}, Name:"", FullName:"", Description:"", Homepage:"", CodeOfConduct:github.CodeOfConduct{}, DefaultBranch:"", MasterBranch:"", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, PushedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, HTMLURL:"", CloneURL:"", GitURL:"", MirrorURL:"", SSHURL:"", SVNURL:"", Language:"", Fork:false, ForksCount:0, NetworkCount:0, OpenIssuesCount:0, OpenIssues:0, StargazersCount:0, SubscribersCount:0, WatchersCount:0, Watchers:0, Size:0, AutoInit:false, Parent:github.Repository{}, Source:github.Repository{}, TemplateRepository:github.Repository{}, Organization:github.Organization{}, AllowRebaseMerge:false, AllowUpdateBranch:false, AllowSquashMerge:false, AllowMergeCommit:false, AllowAutoMerge:false, AllowForking:false, DeleteBranchOnMerge:false, UseSquashPRTitleAsDefault:false, Topics:[""], Archived:false, Disabled:false, License:github.License{}, Private:false, HasIssues:false, HasWiki:false, HasPages:false, HasProjects:false, HasDownloads:false, IsTemplate:false, LicenseTemplate:"", GitignoreTemplate:"", SecurityAndAnalysis:github.SecurityAndAnalysis{}, TeamID:0, URL:"", ArchiveURL:"", AssigneesURL:"", BlobsURL:"", BranchesURL:"", CollaboratorsURL:"", CommentsURL:"", CommitsURL:"", CompareURL:"", ContentsURL:"", ContributorsURL:"", DeploymentsURL:"", DownloadsURL:"", EventsURL:"", ForksURL:"", GitCommitsURL:"", GitRefsURL:"", GitTagsURL:"", HooksURL:"", IssueCommentURL:"", IssueEventsURL:"", IssuesURL:"", KeysURL:"", LabelsURL:"", LanguagesURL:"", MergesURL:"", MilestonesURL:"", NotificationsURL:"", PullsURL:"", ReleasesURL:"", StargazersURL:"", StatusesURL:"", SubscribersURL:"", SubscriptionURL:"", TagsURL:"", TreesURL:"", TeamsURL:"", Visibility:"", RoleName:""}`
 	if got := v.String(); got != want {
 		t.Errorf("Repository.String = %v, want %v", got, want)
 	}
diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go
index c2beca2b..1f060072 100644
--- a/github/orgs_audit_log_test.go
+++ b/github/orgs_audit_log_test.go
@@ -207,6 +207,7 @@ func TestAuditEntry_Marshal(t *testing.T) {
 		Repo:                  String("r"),
 		Repository:            String("repo"),
 		RepositoryPublic:      Bool(false),
+		RunAttempt:            Int64(1),
 		RunnerGroupID:         Int64(1),
 		RunnerGroupName:       String("rgn"),
 		RunnerID:              Int64(1),
@@ -275,6 +276,7 @@ func TestAuditEntry_Marshal(t *testing.T) {
 		"repo": "r",
 		"repository": "repo",
 		"repository_public": false,
+		"run_attempt": 1,
 		"runner_group_id": 1,
 		"runner_group_name": "rgn",
 		"runner_id": 1,
diff --git a/github/repos_codeowners_test.go b/github/repos_codeowners_test.go
new file mode 100644
index 00000000..62c58c5b
--- /dev/null
+++ b/github/repos_codeowners_test.go
@@ -0,0 +1,110 @@
+// Copyright 2022 The go-github AUTHORS. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package github
+
+import (
+	"context"
+	"fmt"
+	"net/http"
+	"testing"
+
+	"github.com/google/go-cmp/cmp"
+)
+
+func TestRepositoriesService_GetCodeownersErrors(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/codeowners/errors", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "GET")
+		testHeader(t, r, "Accept", mediaTypeV3)
+		fmt.Fprint(w, `{
+		  "errors": [
+			{
+			  "line": 1,
+			  "column": 1,
+			  "kind": "Invalid pattern",
+			  "source": "***/*.rb @monalisa",
+			  "suggestion": "Did you mean **/*.rb?",
+			  "message": "Invalid pattern on line 3: Did you mean **/*.rb?\n\n  ***/*.rb @monalisa\n  ^",
+			  "path": ".github/CODEOWNERS"
+			}
+		  ]
+		}
+	`)
+	})
+
+	ctx := context.Background()
+	codeownersErrors, _, err := client.Repositories.GetCodeownersErrors(ctx, "o", "r")
+	if err != nil {
+		t.Errorf("Repositories.GetCodeownersErrors returned error: %v", err)
+	}
+
+	want := &CodeownersErrors{
+		Errors: []*CodeownersError{
+			{
+				Line:       1,
+				Column:     1,
+				Kind:       "Invalid pattern",
+				Source:     "***/*.rb @monalisa",
+				Suggestion: String("Did you mean **/*.rb?"),
+				Message:    "Invalid pattern on line 3: Did you mean **/*.rb?\n\n  ***/*.rb @monalisa\n  ^",
+				Path:       ".github/CODEOWNERS",
+			},
+		},
+	}
+	if !cmp.Equal(codeownersErrors, want) {
+		t.Errorf("Repositories.GetCodeownersErrors returned %+v, want %+v", codeownersErrors, want)
+	}
+
+	const methodName = "GetCodeownersErrors"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.Repositories.GetCodeownersErrors(ctx, "\n", "\n")
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Repositories.GetCodeownersErrors(ctx, "o", "r")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
+
+func TestCodeownersErrors_Marshal(t *testing.T) {
+	testJSONMarshal(t, &CodeownersErrors{}, "{}")
+
+	u := &CodeownersErrors{
+		Errors: []*CodeownersError{
+			{
+				Line:       1,
+				Column:     1,
+				Kind:       "Invalid pattern",
+				Source:     "***/*.rb @monalisa",
+				Suggestion: String("Did you mean **/*.rb?"),
+				Message:    "Invalid pattern on line 3: Did you mean **/*.rb?\n\n  ***/*.rb @monalisa\n  ^",
+				Path:       ".github/CODEOWNERS",
+			},
+		},
+	}
+
+	want := `{
+	  "errors": [
+		{
+		  "line": 1,
+		  "column": 1,
+		  "kind": "Invalid pattern",
+		  "source": "***/*.rb @monalisa",
+		  "suggestion": "Did you mean **/*.rb?",
+		  "message": "Invalid pattern on line 3: Did you mean **/*.rb?\n\n  ***/*.rb @monalisa\n  ^",
+		  "path": ".github/CODEOWNERS"
+		}
+	  ]
+	}
+`
+	testJSONMarshal(t, u, want)
+}
diff --git a/github/repos_lfs_test.go b/github/repos_lfs_test.go
new file mode 100644
index 00000000..f171b6e3
--- /dev/null
+++ b/github/repos_lfs_test.go
@@ -0,0 +1,64 @@
+// Copyright 2022 The go-github AUTHORS. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package github
+
+import (
+	"context"
+	"net/http"
+	"testing"
+)
+
+func TestRepositoriesService_EnableLFS(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/lfs", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "PUT")
+
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	ctx := context.Background()
+	if _, err := client.Repositories.EnableLFS(ctx, "o", "r"); err != nil {
+		t.Errorf("Repositories.EnableLFS returned error: %v", err)
+	}
+
+	const methodName = "EnableLFS"
+	testBadOptions(t, methodName, func() (err error) {
+		_, err = client.Repositories.EnableLFS(ctx, "\n", "\n")
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		return client.Repositories.EnableLFS(ctx, "o", "r")
+	})
+}
+
+func TestRepositoriesService_DisableLFS(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/lfs", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "DELETE")
+
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	ctx := context.Background()
+	if _, err := client.Repositories.DisableLFS(ctx, "o", "r"); err != nil {
+		t.Errorf("Repositories.DisableLFS returned error: %v", err)
+	}
+
+	const methodName = "DisableLFS"
+	testBadOptions(t, methodName, func() (err error) {
+		_, err = client.Repositories.DisableLFS(ctx, "\n", "\n")
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		return client.Repositories.DisableLFS(ctx, "o", "r")
+	})
+}
diff --git a/github/repos_pages_test.go b/github/repos_pages_test.go
index 46bffcff..ed17e735 100644
--- a/github/repos_pages_test.go
+++ b/github/repos_pages_test.go
@@ -76,7 +76,7 @@ func TestRepositoriesService_UpdatePages(t *testing.T) {
 
 	input := &PagesUpdate{
 		CNAME:  String("www.my-domain.com"),
-		Source: String("gh-pages"),
+		Source: &PagesSource{Branch: String("gh-pages")},
 	}
 
 	mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) {
@@ -84,12 +84,12 @@ func TestRepositoriesService_UpdatePages(t *testing.T) {
 		json.NewDecoder(r.Body).Decode(v)
 
 		testMethod(t, r, "PUT")
-		want := &PagesUpdate{CNAME: String("www.my-domain.com"), Source: String("gh-pages")}
+		want := &PagesUpdate{CNAME: String("www.my-domain.com"), Source: &PagesSource{Branch: String("gh-pages")}}
 		if !cmp.Equal(v, want) {
 			t.Errorf("Request body = %+v, want %+v", v, want)
 		}
 
-		fmt.Fprint(w, `{"cname":"www.my-domain.com","source":"gh-pages"}`)
+		fmt.Fprint(w, `{"cname":"www.my-domain.com","source":{"branch":"gh-pages"}}`)
 	})
 
 	ctx := context.Background()
@@ -114,7 +114,7 @@ func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) {
 	defer teardown()
 
 	input := &PagesUpdate{
-		Source: String("gh-pages"),
+		Source: &PagesSource{Branch: String("gh-pages")},
 	}
 
 	mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) {
@@ -123,12 +123,12 @@ func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) {
 			t.Fatalf("unable to read body: %v", err)
 		}
 
-		want := []byte(`{"cname":null,"source":"gh-pages"}` + "\n")
+		want := []byte(`{"cname":null,"source":{"branch":"gh-pages"}}` + "\n")
 		if !bytes.Equal(got, want) {
 			t.Errorf("Request body = %+v, want %+v", got, want)
 		}
 
-		fmt.Fprint(w, `{"cname":null,"source":"gh-pages"}`)
+		fmt.Fprint(w, `{"cname":null,"source":{"branch":"gh-pages"}}`)
 	})
 
 	ctx := context.Background()
@@ -393,12 +393,12 @@ func TestPagesUpdate_Marshal(t *testing.T) {
 
 	u := &PagesUpdate{
 		CNAME:  String("cname"),
-		Source: String("src"),
+		Source: &PagesSource{Path: String("src")},
 	}
 
 	want := `{
 		"cname": "cname",
-		"source": "src"
+		"source": { "path": "src" }
 	}`
 
 	testJSONMarshal(t, u, want)
diff --git a/github/repos_tags_test.go b/github/repos_tags_test.go
new file mode 100644
index 00000000..e5e15a69
--- /dev/null
+++ b/github/repos_tags_test.go
@@ -0,0 +1,132 @@
+// Copyright 2022 The go-github AUTHORS. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package github
+
+import (
+	"context"
+	"encoding/json"
+	"fmt"
+	"net/http"
+	"testing"
+
+	"github.com/google/go-cmp/cmp"
+)
+
+func TestRepositoriesService_ListTagProtection(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/tags/protection", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "GET")
+
+		fmt.Fprint(w, `[{"id":1, "pattern":"tag1"},{"id":2, "pattern":"tag2"}]`)
+	})
+
+	ctx := context.Background()
+	tagProtections, _, err := client.Repositories.ListTagProtection(ctx, "o", "r")
+	if err != nil {
+		t.Errorf("Repositories.ListTagProtection returned error: %v", err)
+	}
+
+	want := []*TagProtection{{ID: Int64(1), Pattern: String("tag1")}, {ID: Int64(2), Pattern: String("tag2")}}
+	if !cmp.Equal(tagProtections, want) {
+		t.Errorf("Repositories.ListTagProtection returned %+v, want %+v", tagProtections, want)
+	}
+
+	const methodName = "ListTagProtection"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.Repositories.ListTagProtection(ctx, "\n", "\n")
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Repositories.ListTagProtection(ctx, "o", "r")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
+
+func TestRepositoriesService_ListTagProtection_invalidOwner(t *testing.T) {
+	client, _, _, teardown := setup()
+	defer teardown()
+
+	ctx := context.Background()
+	_, _, err := client.Repositories.ListTagProtection(ctx, "%", "r")
+	testURLParseError(t, err)
+}
+
+func TestRepositoriesService_CreateTagProtection(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	pattern := "tag*"
+
+	mux.HandleFunc("/repos/o/r/tags/protection", func(w http.ResponseWriter, r *http.Request) {
+		v := new(tagProtectionRequest)
+		json.NewDecoder(r.Body).Decode(v)
+
+		testMethod(t, r, "POST")
+		want := &tagProtectionRequest{Pattern: "tag*"}
+		if !cmp.Equal(v, want) {
+			t.Errorf("Request body = %+v, want %+v", v, want)
+		}
+
+		fmt.Fprint(w, `{"id":1,"pattern":"tag*"}`)
+	})
+
+	ctx := context.Background()
+	got, _, err := client.Repositories.CreateTagProtection(ctx, "o", "r", pattern)
+	if err != nil {
+		t.Errorf("Repositories.CreateTagProtection returned error: %v", err)
+	}
+
+	want := &TagProtection{ID: Int64(1), Pattern: String("tag*")}
+	if !cmp.Equal(got, want) {
+		t.Errorf("Repositories.CreateTagProtection returned %+v, want %+v", got, want)
+	}
+
+	const methodName = "CreateTagProtection"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.Repositories.CreateTagProtection(ctx, "\n", "\n", pattern)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Repositories.CreateTagProtection(ctx, "o", "r", pattern)
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
+
+func TestRepositoriesService_DeleteTagProtection(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/tags/protection/1", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "DELETE")
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	ctx := context.Background()
+	_, err := client.Repositories.DeleteTagProtection(ctx, "o", "r", 1)
+	if err != nil {
+		t.Errorf("Repositories.DeleteTagProtection returned error: %v", err)
+	}
+
+	const methodName = "DeleteTagProtection"
+	testBadOptions(t, methodName, func() (err error) {
+		_, err = client.Repositories.DeleteTagProtection(ctx, "\n", "\n", 1)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		return client.Repositories.DeleteTagProtection(ctx, "o", "r", 1)
+	})
+}
diff --git a/github/repos_test.go b/github/repos_test.go
index 0bf228eb..6b8cbbd2 100644
--- a/github/repos_test.go
+++ b/github/repos_test.go
@@ -1274,6 +1274,11 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) {
 				Users: &[]string{"uu"},
 				Teams: &[]string{"tt"},
 			},
+			BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{
+				Users: []string{"uuu"},
+				Teams: []string{"ttt"},
+				Apps:  []string{"aaa"},
+			},
 		},
 		Restrictions: &BranchRestrictionsRequest{
 			Users: []string{"u"},
@@ -1316,7 +1321,12 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) {
 					}]
 				},
 				"dismiss_stale_reviews":true,
-				"require_code_owner_reviews":true
+				"require_code_owner_reviews":true,
+				"bypass_pull_request_allowances": {
+					"users":[{"id":10,"login":"uuu"}],
+					"teams":[{"id":20,"slug":"ttt"}],
+					"apps":[{"id":30,"slug":"aaa"}]
+				}
 			},
 			"restrictions":{
 				"users":[{"id":1,"login":"u"}],
@@ -1353,6 +1363,17 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) {
 				},
 			},
 			RequireCodeOwnerReviews: true,
+			BypassPullRequestAllowances: &BypassPullRequestAllowances{
+				Users: []*User{
+					{Login: String("uuu"), ID: Int64(10)},
+				},
+				Teams: []*Team{
+					{Slug: String("ttt"), ID: Int64(20)},
+				},
+				Apps: []*App{
+					{Slug: String("aaa"), ID: Int64(30)},
+				},
+			},
 		},
 		Restrictions: &BranchRestrictions{
 			Users: []*User{
@@ -1404,6 +1425,11 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) {
 				Users: &[]string{"uu"},
 				Teams: &[]string{"tt"},
 			},
+			BypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{
+				Users: []string{"uuu"},
+				Teams: []string{"ttt"},
+				Apps:  []string{"aaa"},
+			},
 		},
 		Restrictions: &BranchRestrictionsRequest{
 			Users: []string{"u"},
@@ -1446,7 +1472,12 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) {
 					}]
 				},
 				"dismiss_stale_reviews":true,
-				"require_code_owner_reviews":true
+				"require_code_owner_reviews":true,
+				"bypass_pull_request_allowances": {
+					"users":[{"id":10,"login":"uuu"}],
+					"teams":[{"id":20,"slug":"ttt"}],
+					"apps":[{"id":30,"slug":"aaa"}]
+				}
 			},
 			"restrictions":{
 				"users":[{"id":1,"login":"u"}],
@@ -1483,6 +1514,17 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) {
 				},
 			},
 			RequireCodeOwnerReviews: true,
+			BypassPullRequestAllowances: &BypassPullRequestAllowances{
+				Users: []*User{
+					{Login: String("uuu"), ID: Int64(10)},
+				},
+				Teams: []*Team{
+					{Slug: String("ttt"), ID: Int64(20)},
+				},
+				Apps: []*App{
+					{Slug: String("aaa"), ID: Int64(30)},
+				},
+			},
 		},
 		Restrictions: &BranchRestrictions{
 			Users: []*User{
diff --git a/github/search_test.go b/github/search_test.go
index 4562fcf5..0d49b36c 100644
--- a/github/search_test.go
+++ b/github/search_test.go
@@ -9,6 +9,7 @@ import (
 	"context"
 	"fmt"
 	"net/http"
+	"strings"
 	"testing"
 
 	"github.com/google/go-cmp/cmp"
@@ -61,6 +62,85 @@ func TestSearchService_Repositories_coverage(t *testing.T) {
 	})
 }
 
+func TestSearchService_RepositoriesTextMatch(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/search/repositories", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "GET")
+		textMatchResponse := `
+			{
+				"total_count": 1,
+				"incomplete_results": false,
+				"items": [
+					{
+						"name":"gopher1"
+					}
+				]
+			}
+		`
+		list := strings.Split(r.Header.Get("Accept"), ",")
+		aMap := make(map[string]struct{})
+		for _, s := range list {
+			aMap[strings.TrimSpace(s)] = struct{}{}
+		}
+		if _, ok := aMap["application/vnd.github.v3.text-match+json"]; ok {
+			textMatchResponse = `
+					{
+						"total_count": 1,
+						"incomplete_results": false,
+						"items": [
+							{
+								"name":"gopher1",
+								"text_matches": [
+									{
+										"fragment": "I'm afraid my friend what you have found\nIs a gopher who lives to feed",
+										"matches": [
+											{
+												"text": "gopher",
+												"indices": [
+													14,
+													21
+											]
+											}
+									  ]
+								  }
+							  ]
+							}
+						]
+					}
+				`
+		}
+
+		fmt.Fprint(w, textMatchResponse)
+	})
+
+	opts := &SearchOptions{Sort: "forks", Order: "desc", ListOptions: ListOptions{Page: 2, PerPage: 2}, TextMatch: true}
+	ctx := context.Background()
+	result, _, err := client.Search.Repositories(ctx, "blah", opts)
+	if err != nil {
+		t.Errorf("Search.Code returned error: %v", err)
+	}
+
+	wantedRepoResult := &Repository{
+		Name: String("gopher1"),
+		TextMatches: []*TextMatch{{
+			Fragment: String("I'm afraid my friend what you have found\nIs a gopher who lives to feed"),
+			Matches:  []*Match{{Text: String("gopher"), Indices: []int{14, 21}}},
+		},
+		},
+	}
+
+	want := &RepositoriesSearchResult{
+		Total:             Int(1),
+		IncompleteResults: Bool(false),
+		Repositories:      []*Repository{wantedRepoResult},
+	}
+	if !cmp.Equal(result, want) {
+		t.Errorf("Search.Repo returned %+v, want %+v", result, want)
+	}
+}
+
 func TestSearchService_Topics(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()