Repository: google/go-github
Pull request #2208 (2021-11-23 21:35:06)

Add active committers API implementation
New Method for fetching active committers for an Organization
https://docs.github.com/en/rest/reference/billing#get-github-advanced-security-active-committers-for-an-organization

codecov[bot]: # [Codecov](https://codecov.io/gh/google/go-github/pull/2208?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#2208](https://codecov.io/gh/google/go-github/pull/2208?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (edf4df6) into [master](https://codecov.io/gh/google/go-github/commit/d9d58a291646c518bda16c3effeea81a489dec42?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (d9d58a2) will **increase** coverage by `0.01%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/google/go-github/pull/2208/graphs/tree.svg?width=650&height=150&src=pr&token=EgYjGjZlI0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)](https://codecov.io/gh/google/go-github/pull/2208?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)

```diff
@@            Coverage Diff             @@
##           master    #2208      +/-   ##
==========================================
+ Coverage   97.78%   97.79%   +0.01%     
==========================================
  Files         112      112              
  Lines        9976    10045      +69     
==========================================
+ Hits         9755     9824      +69     
  Misses        154      154              
  Partials       67       67              
```


| [Impacted Files](https://codecov.io/gh/google/go-github/pull/2208?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | |
|---|---|---|
| [github/billing.go](https://codecov.io/gh/google/go-github/pull/2208/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL2JpbGxpbmcuZ28=) | `100.00% <100.00%> (ø)` | |
| [github/code-scanning.go](https://codecov.io/gh/google/go-github/pull/2208/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL2NvZGUtc2Nhbm5pbmcuZ28=) | `100.00% <0.00%> (ø)` | |
| [github/issues\_timeline.go](https://codecov.io/gh/google/go-github/pull/2208/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL2lzc3Vlc190aW1lbGluZS5nbw==) | `100.00% <0.00%> (ø)` | |
| [github/actions\_workflow\_runs.go](https://codecov.io/gh/google/go-github/pull/2208/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL2FjdGlvbnNfd29ya2Zsb3dfcnVucy5nbw==) | `100.00% <0.00%> (ø)` | |
| [github/github.go](https://codecov.io/gh/google/go-github/pull/2208/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL2dpdGh1Yi5nbw==) | `97.60% <0.00%> (+0.01%)` | :arrow_up: |
| [github/repos.go](https://codecov.io/gh/google/go-github/pull/2208/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL3JlcG9zLmdv) | `98.68% <0.00%> (+0.02%)` | :arrow_up: |
| [github/reactions.go](https://codecov.io/gh/google/go-github/pull/2208/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL3JlYWN0aW9ucy5nbw==) | `97.84% <0.00%> (+0.13%)` | :arrow_up: |
| [github/issues.go](https://codecov.io/gh/google/go-github/pull/2208/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL2lzc3Vlcy5nbw==) | `97.41% <0.00%> (+0.35%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/google/go-github/pull/2208?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/2208?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Last update [d9d58a2...edf4df6](https://codecov.io/gh/google/go-github/pull/2208?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).

ganeshkumarsv: @gmlewis I guess I addressed all the review comments. Please let me know if everything looks alright. Thanks!

Patch:
diff --git a/github/actions_workflow_runs.go b/github/actions_workflow_runs.go
index 37bc819a..2c90956c 100644
--- a/github/actions_workflow_runs.go
+++ b/github/actions_workflow_runs.go
@@ -211,6 +211,20 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str
 	return parsedURL, newResponse(resp), err
 }
 
+// DeleteWorkflowRun deletes a workflow run by ID.
+//
+// GitHub API docs: https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run
+func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error) {
+	u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID)
+
+	req, err := s.client.NewRequest("DELETE", u, nil)
+	if err != nil {
+		return nil, err
+	}
+
+	return s.client.Do(ctx, req, nil)
+}
+
 // DeleteWorkflowRunLogs deletes all logs for a workflow run.
 //
 // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-workflow-run-logs
diff --git a/github/billing.go b/github/billing.go
index 190140a4..12a79fa6 100644
--- a/github/billing.go
+++ b/github/billing.go
@@ -44,6 +44,25 @@ type StorageBilling struct {
 	EstimatedStorageForMonth     int     `json:"estimated_storage_for_month"`
 }
 
+// ActiveCommitters represents the total active committers across all repositories in an Organization.
+type ActiveCommitters struct {
+	TotalAdvancedSecurityCommitters int                           `json:"total_advanced_security_committers"`
+	Repositories                    []*RepositoryActiveCommitters `json:"repositories,omitempty"`
+}
+
+// RepositoryActiveCommitters represents active committers on each repository.
+type RepositoryActiveCommitters struct {
+	Name                                *string                                `json:"name,omitempty"`
+	AdvancedSecurityCommitters          *int                                   `json:"advanced_security_committers,omitempty"`
+	AdvancedSecurityCommittersBreakdown []*AdvancedSecurityCommittersBreakdown `json:"advanced_security_committers_breakdown,omitempty"`
+}
+
+// AdvancedSecurityCommittersBreakdown represents the user activity breakdown for ActiveCommitters.
+type AdvancedSecurityCommittersBreakdown struct {
+	UserLogin      *string `json:"user_login,omitempty"`
+	LastPushedDate *string `json:"last_pushed_date,omitempty"`
+}
+
 // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org.
 //
 // GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-github-actions-billing-for-an-organization
@@ -53,8 +72,13 @@ func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) (
 	if err != nil {
 		return nil, nil, err
 	}
+
 	actionsOrgBilling := new(ActionBilling)
 	resp, err := s.client.Do(ctx, req, actionsOrgBilling)
+	if err != nil {
+		return nil, resp, err
+	}
+
 	return actionsOrgBilling, resp, err
 }
 
@@ -67,8 +91,13 @@ func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string)
 	if err != nil {
 		return nil, nil, err
 	}
+
 	packagesOrgBilling := new(PackageBilling)
 	resp, err := s.client.Do(ctx, req, packagesOrgBilling)
+	if err != nil {
+		return nil, resp, err
+	}
+
 	return packagesOrgBilling, resp, err
 }
 
@@ -82,11 +111,35 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) (
 	if err != nil {
 		return nil, nil, err
 	}
+
 	storageOrgBilling := new(StorageBilling)
 	resp, err := s.client.Do(ctx, req, storageOrgBilling)
+	if err != nil {
+		return nil, resp, err
+	}
+
 	return storageOrgBilling, resp, err
 }
 
+// GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository.
+//
+// GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-github-advanced-security-active-committers-for-an-organization
+func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string) (*ActiveCommitters, *Response, error) {
+	u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org)
+	req, err := s.client.NewRequest("GET", u, nil)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	activeOrgCommitters := new(ActiveCommitters)
+	resp, err := s.client.Do(ctx, req, activeOrgCommitters)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return activeOrgCommitters, resp, err
+}
+
 // GetActionsBillingUser returns the summary of the free and paid GitHub Actions minutes used for a user.
 //
 // GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-github-actions-billing-for-a-user
@@ -96,8 +149,13 @@ func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string)
 	if err != nil {
 		return nil, nil, err
 	}
+
 	actionsUserBilling := new(ActionBilling)
 	resp, err := s.client.Do(ctx, req, actionsUserBilling)
+	if err != nil {
+		return nil, resp, err
+	}
+
 	return actionsUserBilling, resp, err
 }
 
@@ -110,8 +168,13 @@ func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string
 	if err != nil {
 		return nil, nil, err
 	}
+
 	packagesUserBilling := new(PackageBilling)
 	resp, err := s.client.Do(ctx, req, packagesUserBilling)
+	if err != nil {
+		return nil, resp, err
+	}
+
 	return packagesUserBilling, resp, err
 }
 
@@ -125,7 +188,12 @@ func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string)
 	if err != nil {
 		return nil, nil, err
 	}
+
 	storageUserBilling := new(StorageBilling)
 	resp, err := s.client.Do(ctx, req, storageUserBilling)
+	if err != nil {
+		return nil, resp, err
+	}
+
 	return storageUserBilling, resp, err
 }
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 7bd87016..b6a846ef 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -156,6 +156,22 @@ func (a *AdvancedSecurity) GetStatus() string {
 	return *a.Status
 }
 
+// GetLastPushedDate returns the LastPushedDate field if it's non-nil, zero value otherwise.
+func (a *AdvancedSecurityCommittersBreakdown) GetLastPushedDate() string {
+	if a == nil || a.LastPushedDate == nil {
+		return ""
+	}
+	return *a.LastPushedDate
+}
+
+// GetUserLogin returns the UserLogin field if it's non-nil, zero value otherwise.
+func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string {
+	if a == nil || a.UserLogin == nil {
+		return ""
+	}
+	return *a.UserLogin
+}
+
 // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.
 func (a *Alert) GetClosedAt() Timestamp {
 	if a == nil || a.ClosedAt == nil {
@@ -13852,6 +13868,22 @@ func (r *Repository) GetWatchersCount() int {
 	return *r.WatchersCount
 }
 
+// GetAdvancedSecurityCommitters returns the AdvancedSecurityCommitters field if it's non-nil, zero value otherwise.
+func (r *RepositoryActiveCommitters) GetAdvancedSecurityCommitters() int {
+	if r == nil || r.AdvancedSecurityCommitters == nil {
+		return 0
+	}
+	return *r.AdvancedSecurityCommitters
+}
+
+// GetName returns the Name field if it's non-nil, zero value otherwise.
+func (r *RepositoryActiveCommitters) GetName() string {
+	if r == nil || r.Name == nil {
+		return ""
+	}
+	return *r.Name
+}
+
 // GetBody returns the Body field if it's non-nil, zero value otherwise.
 func (r *RepositoryComment) GetBody() string {
 	if r == nil || r.Body == nil {
diff --git a/github/github.go b/github/github.go
index 56f1be89..a7afd834 100644
--- a/github/github.go
+++ b/github/github.go
@@ -536,12 +536,18 @@ func (r *Response) populatePageValues() {
 			}
 
 			page := q.Get("page")
+			since := q.Get("since")
 			before := q.Get("before")
 			after := q.Get("after")
-			if page == "" && before == "" && after == "" {
+
+			if page == "" && before == "" && after == "" && since == "" {
 				continue
 			}
 
+			if since != "" {
+				page = since
+			}
+
 			for _, segment := range segments[1:] {
 				switch strings.TrimSpace(segment) {
 				case `rel="next"`:


Test patch:
diff --git a/github/actions_workflow_runs_test.go b/github/actions_workflow_runs_test.go
index fcfbd360..d3623621 100644
--- a/github/actions_workflow_runs_test.go
+++ b/github/actions_workflow_runs_test.go
@@ -334,6 +334,32 @@ func TestActionService_ListRepositoryWorkflowRuns(t *testing.T) {
 	})
 }
 
+func TestActionService_DeleteWorkflowRun(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/repos/o/r/actions/runs/399444496", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "DELETE")
+
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	ctx := context.Background()
+	if _, err := client.Actions.DeleteWorkflowRun(ctx, "o", "r", 399444496); err != nil {
+		t.Errorf("DeleteWorkflowRun returned error: %v", err)
+	}
+
+	const methodName = "DeleteWorkflowRun"
+	testBadOptions(t, methodName, func() (err error) {
+		_, err = client.Actions.DeleteWorkflowRun(ctx, "\n", "\n", 399444496)
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		return client.Actions.DeleteWorkflowRun(ctx, "o", "r", 399444496)
+	})
+}
+
 func TestActionService_DeleteWorkflowRunLogs(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
diff --git a/github/billing_test.go b/github/billing_test.go
index 2693e68a..11acd623 100644
--- a/github/billing_test.go
+++ b/github/billing_test.go
@@ -57,6 +57,14 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) {
 		_, _, err = client.Billing.GetActionsBillingOrg(ctx, "\n")
 		return err
 	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Billing.GetActionsBillingOrg(ctx, "o")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
 }
 
 func TestBillingService_GetActionsBillingOrg_invalidOrg(t *testing.T) {
@@ -101,6 +109,14 @@ func TestBillingService_GetPackagesBillingOrg(t *testing.T) {
 		_, _, err = client.Billing.GetPackagesBillingOrg(ctx, "\n")
 		return err
 	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Billing.GetPackagesBillingOrg(ctx, "o")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
 }
 
 func TestBillingService_GetPackagesBillingOrg_invalidOrg(t *testing.T) {
@@ -145,6 +161,14 @@ func TestBillingService_GetStorageBillingOrg(t *testing.T) {
 		_, _, err = client.Billing.GetStorageBillingOrg(ctx, "\n")
 		return err
 	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Billing.GetStorageBillingOrg(ctx, "o")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
 }
 
 func TestBillingService_GetStorageBillingOrg_invalidOrg(t *testing.T) {
@@ -199,6 +223,14 @@ func TestBillingService_GetActionsBillingUser(t *testing.T) {
 		_, _, err = client.Billing.GetActionsBillingOrg(ctx, "\n")
 		return err
 	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Billing.GetActionsBillingUser(ctx, "o")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
 }
 
 func TestBillingService_GetActionsBillingUser_invalidUser(t *testing.T) {
@@ -243,6 +275,14 @@ func TestBillingService_GetPackagesBillingUser(t *testing.T) {
 		_, _, err = client.Billing.GetPackagesBillingUser(ctx, "\n")
 		return err
 	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Billing.GetPackagesBillingUser(ctx, "o")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
 }
 
 func TestBillingService_GetPackagesBillingUser_invalidUser(t *testing.T) {
@@ -287,6 +327,14 @@ func TestBillingService_GetStorageBillingUser(t *testing.T) {
 		_, _, err = client.Billing.GetStorageBillingUser(ctx, "\n")
 		return err
 	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Billing.GetStorageBillingUser(ctx, "o")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
 }
 
 func TestBillingService_GetStorageBillingUser_invalidUser(t *testing.T) {
@@ -379,3 +427,75 @@ func TestStorageBilling_Marshal(t *testing.T) {
 
 	testJSONMarshal(t, u, want)
 }
+
+func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) {
+	client, mux, _, teardown := setup()
+	defer teardown()
+
+	mux.HandleFunc("/orgs/o/settings/billing/advanced-security", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, "GET")
+		fmt.Fprint(w, `{
+  "total_advanced_security_committers": 2,
+  "repositories": [
+    {
+      "name": "octocat-org/Hello-World",
+      "advanced_security_committers": 2,
+      "advanced_security_committers_breakdown": [
+        {
+          "user_login": "octokitten",
+          "last_pushed_date": "2021-10-25"
+        }
+      ]
+    }
+  ]
+}`)
+	})
+
+	ctx := context.Background()
+	hook, _, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "o")
+	if err != nil {
+		t.Errorf("Billing.GetAdvancedSecurityActiveCommittersOrg	 returned error: %v", err)
+	}
+
+	want := &ActiveCommitters{
+		TotalAdvancedSecurityCommitters: 2,
+		Repositories: []*RepositoryActiveCommitters{
+			{
+				Name:                       String("octocat-org/Hello-World"),
+				AdvancedSecurityCommitters: Int(2),
+				AdvancedSecurityCommittersBreakdown: []*AdvancedSecurityCommittersBreakdown{
+					{
+						UserLogin:      String("octokitten"),
+						LastPushedDate: String("2021-10-25"),
+					},
+				},
+			},
+		},
+	}
+	if !cmp.Equal(hook, want) {
+		t.Errorf("Billing.GetAdvancedSecurityActiveCommittersOrg returned %+v, want %+v", hook, want)
+	}
+
+	const methodName = "GetAdvancedSecurityActiveCommittersOrg"
+	testBadOptions(t, methodName, func() (err error) {
+		_, _, err = client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "\n")
+		return err
+	})
+
+	testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
+		got, resp, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "o")
+		if got != nil {
+			t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
+		}
+		return resp, err
+	})
+}
+
+func TestBillingService_GetAdvancedSecurityActiveCommittersOrg_invalidOrg(t *testing.T) {
+	client, _, _, teardown := setup()
+	defer teardown()
+
+	ctx := context.Background()
+	_, _, err := client.Billing.GetAdvancedSecurityActiveCommittersOrg(ctx, "%")
+	testURLParseError(t, err)
+}
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index bbdff0ad..6cc5dfbf 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -163,6 +163,26 @@ func TestAdvancedSecurity_GetStatus(tt *testing.T) {
 	a.GetStatus()
 }
 
+func TestAdvancedSecurityCommittersBreakdown_GetLastPushedDate(tt *testing.T) {
+	var zeroValue string
+	a := &AdvancedSecurityCommittersBreakdown{LastPushedDate: &zeroValue}
+	a.GetLastPushedDate()
+	a = &AdvancedSecurityCommittersBreakdown{}
+	a.GetLastPushedDate()
+	a = nil
+	a.GetLastPushedDate()
+}
+
+func TestAdvancedSecurityCommittersBreakdown_GetUserLogin(tt *testing.T) {
+	var zeroValue string
+	a := &AdvancedSecurityCommittersBreakdown{UserLogin: &zeroValue}
+	a.GetUserLogin()
+	a = &AdvancedSecurityCommittersBreakdown{}
+	a.GetUserLogin()
+	a = nil
+	a.GetUserLogin()
+}
+
 func TestAlert_GetClosedAt(tt *testing.T) {
 	var zeroValue Timestamp
 	a := &Alert{ClosedAt: &zeroValue}
@@ -16176,6 +16196,26 @@ func TestRepository_GetWatchersCount(tt *testing.T) {
 	r.GetWatchersCount()
 }
 
+func TestRepositoryActiveCommitters_GetAdvancedSecurityCommitters(tt *testing.T) {
+	var zeroValue int
+	r := &RepositoryActiveCommitters{AdvancedSecurityCommitters: &zeroValue}
+	r.GetAdvancedSecurityCommitters()
+	r = &RepositoryActiveCommitters{}
+	r.GetAdvancedSecurityCommitters()
+	r = nil
+	r.GetAdvancedSecurityCommitters()
+}
+
+func TestRepositoryActiveCommitters_GetName(tt *testing.T) {
+	var zeroValue string
+	r := &RepositoryActiveCommitters{Name: &zeroValue}
+	r.GetName()
+	r = &RepositoryActiveCommitters{}
+	r.GetName()
+	r = nil
+	r.GetName()
+}
+
 func TestRepositoryComment_GetBody(tt *testing.T) {
 	var zeroValue string
 	r := &RepositoryComment{Body: &zeroValue}
diff --git a/github/github_test.go b/github/github_test.go
index dfa0d338..3a0c2931 100644
--- a/github/github_test.go
+++ b/github/github_test.go
@@ -648,6 +648,35 @@ func TestResponse_populatePageValues(t *testing.T) {
 	}
 }
 
+func TestResponse_populateSinceValues(t *testing.T) {
+	r := http.Response{
+		Header: http.Header{
+			"Link": {`<https://api.github.com/?since=1>; rel="first",` +
+				` <https://api.github.com/?since=2>; rel="prev",` +
+				` <https://api.github.com/?since=4>; rel="next",` +
+				` <https://api.github.com/?since=5>; rel="last"`,
+			},
+		},
+	}
+
+	response := newResponse(&r)
+	if got, want := response.FirstPage, 1; got != want {
+		t.Errorf("response.FirstPage: %v, want %v", got, want)
+	}
+	if got, want := response.PrevPage, 2; want != got {
+		t.Errorf("response.PrevPage: %v, want %v", got, want)
+	}
+	if got, want := response.NextPage, 4; want != got {
+		t.Errorf("response.NextPage: %v, want %v", got, want)
+	}
+	if got, want := response.LastPage, 5; 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_cursorPagination(t *testing.T) {
 	r := http.Response{
 		Header: http.Header{
@@ -761,6 +790,45 @@ func TestResponse_populatePageValues_invalid(t *testing.T) {
 	}
 }
 
+func TestResponse_populateSinceValues_invalid(t *testing.T) {
+	r := http.Response{
+		Header: http.Header{
+			"Link": {`<https://api.github.com/?since=1>,` +
+				`<https://api.github.com/?since=abc>; rel="first",` +
+				`https://api.github.com/?since=2; rel="prev",` +
+				`<https://api.github.com/>; rel="next",` +
+				`<https://api.github.com/?since=>; rel="last"`,
+			},
+		},
+	}
+
+	response := newResponse(&r)
+	if got, want := response.FirstPage, 0; got != want {
+		t.Errorf("response.FirstPage: %v, want %v", got, want)
+	}
+	if got, want := response.PrevPage, 0; got != want {
+		t.Errorf("response.PrevPage: %v, want %v", got, want)
+	}
+	if got, want := response.NextPage, 0; got != want {
+		t.Errorf("response.NextPage: %v, want %v", got, want)
+	}
+	if got, want := response.LastPage, 0; got != want {
+		t.Errorf("response.LastPage: %v, want %v", got, want)
+	}
+
+	// more invalid URLs
+	r = http.Response{
+		Header: http.Header{
+			"Link": {`<https://api.github.com/%?since=2>; rel="first"`},
+		},
+	}
+
+	response = newResponse(&r)
+	if got, want := response.FirstPage, 0; got != want {
+		t.Errorf("response.FirstPage: %v, want %v", got, want)
+	}
+}
+
 func TestDo(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()